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



The following reply was made to PR kern/46696; it has been noted by GNATS.

From: kato%wide.ad.jp@localhost
To: skrll%netbsd.org@localhost
Cc: gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, 
mishka%NetBSD.org@localhost
Subject: Re: kern/46696: uhub disables port where USB keyboard attached
Date: Tue, 02 Apr 2013 15:39:44 +0900 (JST)

 Dear Nick,
 
 When applied with netbsd-6 tree, in 11 trials, the USB keyboard didn't
 recognize correctly out of 20 trials. The diff was as follows:
 
 Index: usb_subr.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/usb_subr.c,v
 retrieving revision 1.180
 diff -u -p -u -r1.180 usb_subr.c
 --- usb_subr.c 9 Jun 2011 19:08:33 -0000       1.180
 +++ usb_subr.c 2 Apr 2013 06:37:13 -0000
 @@ -1219,14 +1219,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(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL,
 @@ -1237,6 +1229,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: ehci.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/ehci.c,v
 retrieving revision 1.183
 diff -u -p -u -r1.183 ehci.c
 --- ehci.c     23 Dec 2011 00:51:43 -0000      1.183
 +++ ehci.c     2 Apr 2013 06:37:28 -0000
 @@ -3271,7 +3271,9 @@ ehci_device_request(usbd_xfer_handle xfe
        usb_device_request_t *req = &xfer->request;
        usbd_device_handle dev = epipe->pipe.device;
        ehci_softc_t *sc = dev->bus->hci_private;
 +#if 0
        int addr = dev->address;
 +#endif
        ehci_soft_qtd_t *setup, *stat, *next;
        ehci_soft_qh_t *sqh;
        int isread;
 @@ -3302,6 +3304,7 @@ ehci_device_request(usbd_xfer_handle xfe
        sqh = epipe->sqh;
        epipe->u.ctl.length = len;
  
 +#if 0
        /* Update device address and length since they may have changed
           during the setup of the control pipe in usbd_new_device(). */
        /* XXX This only needs to be done once, but it's too early in open. */
 @@ -3312,6 +3315,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) {
 


Home | Main Index | Thread Index | Old Index