summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2016-04-18 13:09:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-26 15:04:38 -0700
commit5b91dfe187bbe3a8116432016375f39fff91a237 (patch)
treea773717d09fd6af49a154f8c6e702e904480f4b7 /drivers/usb
parent779b457f66e10de3471479373463b27fd308dc85 (diff)
downloadop-kernel-dev-5b91dfe187bbe3a8116432016375f39fff91a237.zip
op-kernel-dev-5b91dfe187bbe3a8116432016375f39fff91a237.tar.gz
usb: storage: scsiglue: limit USB3 devices to 2048 sectors
USB3 devices, because they are much newer, have much less chance of having issues with larger transfers. We still keep a limit because anything above 2048 sectors really rendered negligible speed improvements, so we will simply ignore that. Transferring 1MiB should already give us pretty good performance. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/storage/scsiglue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 9da1fb3..8892014 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -133,6 +133,11 @@ static int slave_configure(struct scsi_device *sdev)
* let the queue segment size sort out the real limit.
*/
blk_queue_max_hw_sectors(sdev->request_queue, 0x7FFFFF);
+ } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) {
+ /* USB3 devices will be limited to 2048 sectors. This gives us
+ * better throughput on most devices.
+ */
+ blk_queue_max_hw_sectors(sdev->request_queue, 2048);
}
/* Some USB host controllers can't do DMA; they have to use PIO.
OpenPOWER on IntegriCloud