From owner-freebsd-usb@FreeBSD.ORG Sat Apr 25 08:10:02 2009 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E987A106566C for ; Sat, 25 Apr 2009 08:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C5BF78FC14 for ; Sat, 25 Apr 2009 08:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n3P8A2Ft097366 for ; Sat, 25 Apr 2009 08:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n3P8A25h097365; Sat, 25 Apr 2009 08:10:02 GMT (envelope-from gnats) Resent-Date: Sat, 25 Apr 2009 08:10:02 GMT Resent-Message-Id: <200904250810.n3P8A25h097365@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Emil Mikulic Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3E611065676 for ; Sat, 25 Apr 2009 08:00:16 +0000 (UTC) (envelope-from emil@dmr.ath.cx) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by mx1.freebsd.org (Postfix) with ESMTP id CFA8D8FC13 for ; Sat, 25 Apr 2009 08:00:07 +0000 (UTC) (envelope-from emil@dmr.ath.cx) Received: from ppp154-240.static.internode.on.net ([150.101.154.240]) by ipmail04.adl2.internode.on.net with ESMTP; 25 Apr 2009 17:14:48 +0930 Received: by ppp154-240.static.internode.on.net (Poo-fix, from userid 1001) id 220715C45; Sat, 25 Apr 2009 17:44:47 +1000 (EST) Message-Id: <20090425074447.220715C45@ppp154-240.static.internode.on.net> Date: Sat, 25 Apr 2009 17:44:47 +1000 (EST) From: Emil Mikulic To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: usb/133989: USB keyboard dead at mountroot> prompt X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2009 08:10:03 -0000 >Number: 133989 >Category: usb >Synopsis: USB keyboard dead at mountroot> prompt >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 25 08:10:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Emil Mikulic >Release: FreeBSD 8-CURRENT r191477 >Organization: >Environment: i386 >Description: At boot time, if I get dropped to the mountroot> prompt due to e.g. screwing up vfs.root.mountfrom, my USB keyboard doesn't respond at all, and I can't do anything but hard-reset my computer. emax's r191164 makes no difference ("Prevent atkbd(4) interrupt handler from calling keyboard callback function when polled mode is enabled.") Kernels before and after that patch behave the same. Removing kbdmux also has no effect. Removing all of USB2 from the kernel config makes the keyboard work at the mountroot> prompt (BIOS emulation?) In a healthy boot, ukbd0 doesn't get recognized until -after- the root FS is mounted and /sbin/init starts. At Hans Petter Selasky's suggestion, I added a pause() to cngetc(): --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -353,7 +353,7 @@ cngetc(void) if (cn_mute) return (-1); while ((c = cncheckc()) == -1) - ; + pause("WAIT", hz/10); if (c == '\r') c = '\n'; /* console input is always ICRNL */ return (c); With this change, a few seconds after the mountroot> prompt is displayed, the USB keyboard is detected (and added to kbdmux) and I can hit scroll lock and scroll up and down, and even hit Ctrl+PrtScr to break into debugger (which then gets into an infinite loop of panics), but I can't get keypresses through to the mountroot> prompt. Giant is picked up in start_init() and I'm pretty sure is held in cngetc(). I've tried dropping it around the pause() above but that made no difference. >How-To-Repeat: On a system with only a USB keyboard, at the /boot/loader prompt, set vfs.root.mountfrom="ufs:something/silly" and boot. >Fix: >Release-Note: >Audit-Trail: >Unformatted: