From owner-freebsd-arch@FreeBSD.ORG Sat Dec 28 23:31:00 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A03C27C for ; Sat, 28 Dec 2013 23:31:00 +0000 (UTC) Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com [209.85.213.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E5C401387 for ; Sat, 28 Dec 2013 23:30:58 +0000 (UTC) Received: by mail-ig0-f177.google.com with SMTP id uy17so24701456igb.4 for ; Sat, 28 Dec 2013 15:30:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version; bh=GCLwnBojW2jjhbdEYd7R4oGg4+lO1iwqH1Xl91O7OiA=; b=gO8wXitKnKBJu2LkJZQdlcHQeFkdv5WNDDI5VkZia8BdcOPCIlNRAKt/Rt6UmL1Crl uLEiyr+Y8ZnmKJdKKM4xfKVa1BXeDg11lwzynfGMUc7cs34lB25OhZDaIEBxswaB7XCz c9uPt2632PZJP5MraaXSXC7hhbI2KV1j+H63SUMVTs9eH7Dn1SGCI+MoUR61SA22q19j zJnzSn5diVF4ktPAF1QPWcsum7OjcZ29BHqNMXX5FVjpAJLfnMB77HDgnpAGhEqwpoJI a47IH1HXjPl07EBr2llbDf1ZHS+aCowuyYjW2AfykLd72obc+U6LNxwQW/YVlPDVA8wr MphA== X-Gm-Message-State: ALoCoQm9fFy51CH/aFxUN2vQ9sDnqvqMWGnoD9nmqwmhhL4tEW6BfJqZ9RUVirE6hTsqLBGzuXfB X-Received: by 10.50.176.165 with SMTP id cj5mr47305252igc.19.1388273458093; Sat, 28 Dec 2013 15:30:58 -0800 (PST) Received: from fusion-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id qb4sm20169180igb.7.2013.12.28.15.30.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Dec 2013 15:30:57 -0800 (PST) Sender: Warner Losh From: Warner Losh Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: UART grab patch Date: Sat, 28 Dec 2013 16:30:56 -0700 Message-Id: <79C659B9-F402-42B6-8240-C4AB0A0EB92B@bsdimp.com> To: "freebsd-arch@freebsd.org Arch" Mime-Version: 1.0 (Apple Message framework v1085) X-Mailer: Apple Mail (2.1085) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2013 23:31:00 -0000 OK. Looks like my initial assessment of mountroot was too optimistic. = With the exception of the imx driver, all the uart drivers in the tree = fell victim to this bug. I hit a second one with the Raspberry Pi, and = went looking. I've uploaded a patch to http://people.freebsd.org/~imp/uart-grab.diff = that should solve the problem. I don't have all these systems to test = on, so I'm hoping people can report back to me what works and what = doesn't. Boot -a with and without the patch for all serial consoles = will tell you if it is working. Type stuff. If it appears exactly as you = type it, then the patch is working. If not, please let me know. The basic strategy for all these is to disable RX interrupts when the = console is grabbed, and enable them when it is ungrabbed. This has to be = done in the hardware, since masking the interrupt at the CPU or PIC = level will cause many UARTs to misbehave and/or prevent other interrupts = from happening that are shared which can cause problems on some = platforms. Comments and critiques of these patches are welcome. I posted to arch@ = because it affects so many different platforms at once, and this seems = like a arch@y thing... Warner