usb-storage: Workaround devices with bogus sense size
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 13 Oct 2009 04:53:47 +0000 (15:53 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 14 Oct 2009 21:54:44 +0000 (14:54 -0700)
usb-storage: Workaround devices with bogus sense size

Some devices, such as Huawei E169, advertise more than the standard
amount of sense data, causing us to set US_FL_SANE_SENSE, assuming
they support it. However, they subsequently fail the request sense
with that size.

This works around it generically. When a sense request fails due to
a device returning an error, US_FL_SANE_SENSE was set, and that sense
request used a larger sense size, we retry with a smaller size before
giving up.

Based on an original patch by Ben Efros <ben@pc-doctor.com>

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

No differences found