usb/133989: USB keyboard dead at mountroot> prompt

Emil Mikulic emikulic at gmail.com
Sat Apr 25 08:10:03 UTC 2009


>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:


More information about the freebsd-usb mailing list