aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2009-12-18 06:14:21 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:53:23 -0500
commit5d3987796c7a747e5ed3ded1eb64a9632d52a1a4 (patch)
treef677d4014bd5e25d1f4ccac1862fd95655baedec /drivers/usb/storage
parentd1b5b5c0a8a8204f0c51d5eb99736ecfb2fd5b4e (diff)
USB: storage: Never reset devices that will morph to an old mode
Some devices must be switched to a new mode to fully use them. A reset would make them revert to the old mode. Therefore a reset must not be used for error handling with such devices. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/transport.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index cc313d16d727..468038126e5e 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -47,6 +47,8 @@
47#include <linux/errno.h> 47#include <linux/errno.h>
48#include <linux/slab.h> 48#include <linux/slab.h>
49 49
50#include <linux/usb/quirks.h>
51
50#include <scsi/scsi.h> 52#include <scsi/scsi.h>
51#include <scsi/scsi_eh.h> 53#include <scsi/scsi_eh.h>
52#include <scsi/scsi_device.h> 54#include <scsi/scsi_device.h>
@@ -1297,6 +1299,10 @@ int usb_stor_port_reset(struct us_data *us)
1297{ 1299{
1298 int result; 1300 int result;
1299 1301
1302 /*for these devices we must use the class specific method */
1303 if (us->pusb_dev->quirks & USB_QUIRK_RESET_MORPHS)
1304 return -EPERM;
1305
1300 result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf); 1306 result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
1301 if (result < 0) 1307 if (result < 0)
1302 US_DEBUGP("unable to lock device for reset: %d\n", result); 1308 US_DEBUGP("unable to lock device for reset: %d\n", result);