Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [5.0] USB device ignored on boot



On Sun, Jul 19, 2009 at 10:55 PM, Andreas Wrede<andreas%wrede.ca@localhost> 
wrote:
> I am running NetBSD/amd64 5.0_STABLE on a Gigabyte GA-MA78GM-US2H
> motherboard with three uplcom(4) USB to serial adapters.  On boot, only two
> of these are recognized, I have to manually un- and re-plug the third
> adapter in order to get it attached. (See end of the dmesg output). Un- and
> re-plugging is not even a work-around since the machine is running remotely
> - unattended.
>
> I also noticed that the output from the attach of the second uplcom(4)
> adapter gets intermixed with other boot messages:
>
> [...]
> ucom0 at uplcom0
> uplcom1 at uhub1 port 1boot device: wd0
> root on wd0a dumps on wd0b
>
> uplcom1: Prolific Technology Inc. USB-Serial Controller, rev 1.10/3.00, addr
> 2
> [...]
>
> Is there a locking issue here?
>
>
> --
>    aew
>
>
Hi,

I think there is a race condition in the stack. I believe ehci should
initialize before ohci but it does not (on my machine). The comment in
the source suggests the author was aware of this but delayed both ehci
and ohci instead of just ohci.
" ...
        /*
         * In case this controller is a companion controller to an
         * EHCI controller we need to wait until the EHCI controller
         * has grabbed the port.  ....
"

I have included my hack that seems to work for me on 5.0.

-Luazi


Index: usr/src/sys/dev/usb/usb.c
===================================================================
--- usr/src/sys/dev/usb/usb.c   (revision 2)
+++ usr/src/sys/dev/usb/usb.c   (working copy)
@@ -367,8 +367,13 @@
         * know how to synchronize the creation of the threads so it
         * will work.
         */
-       usb_delay_ms(sc->sc_bus, 500);
+       if (USBREV_2_0 != sc->sc_bus->usbrev)
+       {
+           /*FIXME: yeah right*/
+           usb_delay_ms(sc->sc_bus, 2000);
+       }

        /* Make sure first discover does something. */
        sc->sc_bus->needs_explore = 1;
        usb_discover(sc);


Home | Main Index | Thread Index | Old Index