Skip to content

Commit 198de51

Browse files
jwrdegoedegregkh
authored andcommitted
USB: uas: Limit qdepth at the scsi-host level
Commit 64d513a ("scsi: use host wide tags by default") causes the SCSI core to queue more commands then we can handle on devices with multiple LUNs, limit the queue depth at the scsi-host level instead of per slave to fix this. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1315013 Cc: stable@vger.kernel.org # 4.4.x and 4.5.x Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2dc0194 commit 198de51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/usb/storage/uas.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,6 @@ static int uas_slave_configure(struct scsi_device *sdev)
824824
if (devinfo->flags & US_FL_BROKEN_FUA)
825825
sdev->broken_fua = 1;
826826

827-
scsi_change_queue_depth(sdev, devinfo->qdepth - 2);
828827
return 0;
829828
}
830829

@@ -956,6 +955,12 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
956955
if (result)
957956
goto set_alt0;
958957

958+
/*
959+
* 1 tag is reserved for untagged commands +
960+
* 1 tag to avoid off by one errors in some bridge firmwares
961+
*/
962+
shost->can_queue = devinfo->qdepth - 2;
963+
959964
usb_set_intfdata(intf, shost);
960965
result = scsi_add_host(shost, &intf->dev);
961966
if (result)

0 commit comments

Comments
 (0)