summaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/scsiglue.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2013-10-14 15:24:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-16 13:32:04 -0700
commit32c37fc30c52508711ea6a108cfd5855b8a07176 (patch)
tree0e27849089be2e0f12bbcab665062e2f7d2454a0 /drivers/usb/storage/scsiglue.c
parentfd8573f5828873343903215f203f14dc82de397c (diff)
downloadblackbird-op-linux-32c37fc30c52508711ea6a108cfd5855b8a07176.tar.gz
blackbird-op-linux-32c37fc30c52508711ea6a108cfd5855b8a07176.zip
usb-storage: add quirk for mandatory READ_CAPACITY_16
Some USB drive enclosures do not correctly report an overflow condition if they hold a drive with a capacity over 2TB and are confronted with a READ_CAPACITY_10. They answer with their capacity modulo 2TB. The generic layer cannot cope with that. It must be told to use READ_CAPACITY_16 from the beginning. Signed-off-by: Oliver Neukum <oneukum@suse.de> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r--drivers/usb/storage/scsiglue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 94d75edef77f..18509e6c21ab 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -211,8 +211,11 @@ static int slave_configure(struct scsi_device *sdev)
/*
* Many devices do not respond properly to READ_CAPACITY_16.
* Tell the SCSI layer to try READ_CAPACITY_10 first.
+ * However some USB 3.0 drive enclosures return capacity
+ * modulo 2TB. Those must use READ_CAPACITY_16
*/
- sdev->try_rc_10_first = 1;
+ if (!(us->fflags & US_FL_NEEDS_CAP16))
+ sdev->try_rc_10_first = 1;
/* assume SPC3 or latter devices support sense size > 18 */
if (sdev->scsi_level > SCSI_SPC_2)
OpenPOWER on IntegriCloud