diff options
author | Hans de Goede <hdegoede@redhat.com> | 2016-04-12 06:27:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-13 15:02:28 -0400 |
commit | 198de51dbc3454d95b015ca0a055b673f85f01bb (patch) | |
tree | 665fd5a7f6e7698777fda58b04e471a0c0c4a011 | |
parent | 2dc0194c1d0df078dc4a7bf539ce9bda7e6f1a41 (diff) |
USB: uas: Limit qdepth at the scsi-host level
Commit 64d513ac31bd ("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>
-rw-r--r-- | drivers/usb/storage/uas.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 13e4cc31bc79..b1ec7499166d 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
@@ -824,7 +824,6 @@ static int uas_slave_configure(struct scsi_device *sdev) | |||
824 | if (devinfo->flags & US_FL_BROKEN_FUA) | 824 | if (devinfo->flags & US_FL_BROKEN_FUA) |
825 | sdev->broken_fua = 1; | 825 | sdev->broken_fua = 1; |
826 | 826 | ||
827 | scsi_change_queue_depth(sdev, devinfo->qdepth - 2); | ||
828 | return 0; | 827 | return 0; |
829 | } | 828 | } |
830 | 829 | ||
@@ -956,6 +955,12 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
956 | if (result) | 955 | if (result) |
957 | goto set_alt0; | 956 | goto set_alt0; |
958 | 957 | ||
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 | |||
959 | usb_set_intfdata(intf, shost); | 964 | usb_set_intfdata(intf, shost); |
960 | result = scsi_add_host(shost, &intf->dev); | 965 | result = scsi_add_host(shost, &intf->dev); |
961 | if (result) | 966 | if (result) |