NetBSD-Bugs archive

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

Re: kern/46696: uhub disables port where USB keyboard attached



On 03/26/13 05:28, kato%wide.ad.jp@localhost wrote:
Nick,

I tested your patch for netbsd-6. 4 times out of 20 times reboot, the
USB keyboard didn't recognized correctly.


Not sure if that is an improvement on -current. Can you try this patch on it's own and with the 8 bytes read patch.

usbdebug output from a failure would be useful.

Thanks,
Nick

Index: sys/dev/usb/usb_subr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usb_subr.c,v
retrieving revision 1.190
diff -u -p -u -r1.190 usb_subr.c
--- sys/dev/usb/usb_subr.c      20 Mar 2013 11:14:51 -0000      1.190
+++ sys/dev/usb/usb_subr.c      29 Mar 2013 16:48:02 -0000
@@ -1253,14 +1266,6 @@ usbd_new_device(device_t parent, usbd_bu
        dev->address = addr;    /* new device address now */
        bus->devices[addr] = dev;
 
-       err = usbd_reload_device_desc(dev);
-       if (err) {
-               DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
-                             "failed\n", addr));
-               usbd_remove_device(dev, up);
-               return (err);
-       }
-
        /* Re-establish the default pipe with the new address. */
        usbd_kill_pipe(dev->default_pipe);
        err = usbd_setup_pipe_flags(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL,
@@ -1271,6 +1276,14 @@ usbd_new_device(device_t parent, usbd_bu
                return err;
        }
 
+       err = usbd_reload_device_desc(dev);
+       if (err) {
+               DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
+                             "failed\n", addr));
+               usbd_remove_device(dev, up);
+               return (err);
+       }
+
        /* Assume 100mA bus powered for now. Changed when configured. */
        dev->power = USB_MIN_POWER;
        dev->self_powered = 0;
Index: sys/dev/usb/ehci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ehci.c,v
retrieving revision 1.205
diff -u -p -u -r1.205 ehci.c
--- sys/dev/usb/ehci.c  1 Feb 2013 12:53:47 -0000       1.205
+++ sys/dev/usb/ehci.c  29 Mar 2013 16:48:04 -0000
@@ -3377,6 +3377,7 @@ ehci_device_request(usbd_xfer_handle xfe
 
        sqh = epipe->sqh;
 
+#if 0
        /*
         * Update device address and length since they may have changed
         * during the setup of the control pipe in usbd_new_device().
@@ -3389,7 +3390,7 @@ ehci_device_request(usbd_xfer_handle xfe
             EHCI_QH_SET_ADDR(addr) |
             EHCI_QH_SET_MPL(UGETW(epipe->pipe.endpoint->edesc->wMaxPacketSize))
            );
-
+#endif
        /* Set up data transaction */
        if (len != 0) {
                ehci_soft_qtd_t *end;



Home | Main Index | Thread Index | Old Index