diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-08-14 10:56:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-08-22 17:27:49 -0400 |
commit | 46dede4690bbb23a2c9d60561e2e4fdc3e6bee61 (patch) | |
tree | 98f9a30c7105294df497eb59722a54f70b9a294d /drivers/usb | |
parent | f095137e799ddb6a7c2bf0e4c73cda193ab9df41 (diff) |
USB: accept 1-byte Device Status replies, fixing some b0rken devices
Some devices have a bug which causes them to send a 1-byte reply to
Get-Device-Status requests instead of 2 bytes as required by the
spec. This doesn't play well with autosuspend, since we look for a
valid status reply to make sure the device is still present when it
resumes. Without both bytes, we assume the device has been
disconnected.
Lack of the second byte shouldn't matter much, since the spec requires
it always to be equal to 0. Hence this patch (as959) causes
finish_port_resume() to accept a 1-byte reply as valid.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/hub.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e341a1da517f..f7b337feb3ea 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1644,9 +1644,10 @@ static int finish_port_resume(struct usb_device *udev) | |||
1644 | * and device drivers will know about any resume quirks. | 1644 | * and device drivers will know about any resume quirks. |
1645 | */ | 1645 | */ |
1646 | if (status == 0) { | 1646 | if (status == 0) { |
1647 | devstatus = 0; | ||
1647 | status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); | 1648 | status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); |
1648 | if (status >= 0) | 1649 | if (status >= 0) |
1649 | status = (status == 2 ? 0 : -ENODEV); | 1650 | status = (status > 0 ? 0 : -ENODEV); |
1650 | } | 1651 | } |
1651 | 1652 | ||
1652 | if (status) { | 1653 | if (status) { |