diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-05-11 10:19:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-05-23 02:45:49 -0400 |
commit | b89ee19ae6c0b5a0d9facca780b53959fbadd123 (patch) | |
tree | d777fc2bda8cce83cd2104c7e74857b501025c04 /drivers | |
parent | d984abc97e400d68a09729b80060fe0ec591eb16 (diff) |
USB: remove short initial timeout for device descriptor fetch
This patch (as905) removes a micro-optimization from the hub port
initialization code. Previously we had been using a short timeout on
the first attempt the read the device descriptor; now we will use the
standard timeout length.
It's not clear that the short timeout ever provided any benefit. And
now we know of one case where it actually hurts: The device can't meet
the short timeout and then it gets terminally confused.
This fixes Bugzilla #8444.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/hub.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index f6b74a678de5..6a6e4f8c69ba 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2201,14 +2201,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2201 | continue; | 2201 | continue; |
2202 | } | 2202 | } |
2203 | 2203 | ||
2204 | /* Use a short timeout the first time through, | 2204 | /* Retry on all errors; some devices are flakey. |
2205 | * so that recalcitrant full-speed devices with | 2205 | * 255 is for WUSB devices, we actually need to use |
2206 | * 8- or 16-byte ep0-maxpackets won't slow things | 2206 | * 512 (WUSB1.0[4.8.1]). |
2207 | * down tremendously by NAKing the unexpectedly | ||
2208 | * early status stage. Also, retry on all errors; | ||
2209 | * some devices are flakey. | ||
2210 | * 255 is for WUSB devices, we actually need to use 512. | ||
2211 | * WUSB1.0[4.8.1]. | ||
2212 | */ | 2207 | */ |
2213 | for (j = 0; j < 3; ++j) { | 2208 | for (j = 0; j < 3; ++j) { |
2214 | buf->bMaxPacketSize0 = 0; | 2209 | buf->bMaxPacketSize0 = 0; |
@@ -2216,7 +2211,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2216 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, | 2211 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, |
2217 | USB_DT_DEVICE << 8, 0, | 2212 | USB_DT_DEVICE << 8, 0, |
2218 | buf, GET_DESCRIPTOR_BUFSIZE, | 2213 | buf, GET_DESCRIPTOR_BUFSIZE, |
2219 | (i ? USB_CTRL_GET_TIMEOUT : 1000)); | 2214 | USB_CTRL_GET_TIMEOUT); |
2220 | switch (buf->bMaxPacketSize0) { | 2215 | switch (buf->bMaxPacketSize0) { |
2221 | case 8: case 16: case 32: case 64: case 255: | 2216 | case 8: case 16: case 32: case 64: case 255: |
2222 | if (buf->bDescriptorType == | 2217 | if (buf->bDescriptorType == |