aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/scsiglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r--drivers/usb/storage/scsiglue.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 836a34ae6ec6..7c9593b7b04e 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -114,9 +114,15 @@ static int slave_configure(struct scsi_device *sdev)
114 * while others have trouble with more than 64K. At this time we 114 * while others have trouble with more than 64K. At this time we
115 * are limiting both to 32K (64 sectores). 115 * are limiting both to 32K (64 sectores).
116 */ 116 */
117 if ((us->flags & US_FL_MAX_SECTORS_64) && 117 if (us->flags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) {
118 sdev->request_queue->max_sectors > 64) 118 unsigned int max_sectors = 64;
119 blk_queue_max_sectors(sdev->request_queue, 64); 119
120 if (us->flags & US_FL_MAX_SECTORS_MIN)
121 max_sectors = PAGE_CACHE_SIZE >> 9;
122 if (sdev->request_queue->max_sectors > max_sectors)
123 blk_queue_max_sectors(sdev->request_queue,
124 max_sectors);
125 }
120 126
121 /* We can't put these settings in slave_alloc() because that gets 127 /* We can't put these settings in slave_alloc() because that gets
122 * called before the device type is known. Consequently these 128 * called before the device type is known. Consequently these