public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] uas: leave can_queue as MAX_CMNDS if device reports larger qdepth
@ 2016-05-23 16:02 tom.ty89
  2016-05-23 17:00 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: tom.ty89 @ 2016-05-23 16:02 UTC (permalink / raw)
  To: gregkh; +Cc: kraxel, stern, linux-usb, linux-scsi, stable, hdegoede, Tom Yan

From: Tom Yan <tom.ty89@gmail.com>

Commit 198de51dbc34 ("USB: uas: Limit qdepth at the scsi-host level") made
qdepth limit set in host template (`.can_queue = MAX_CMNDS`) useless.

Instead of removing the template limit, now we only change limit according
to the qdepth reported by the device if it is smaller than MAX_CMNDS.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 4d49fce..d7790e6 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -972,7 +972,8 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	 * 1 tag is reserved for untagged commands +
 	 * 1 tag to avoid off by one errors in some bridge firmwares
 	 */
-	shost->can_queue = devinfo->qdepth - 2;
+	if (devinfo->qdepth - 2 < MAX_CMNDS)
+		shost->can_queue = devinfo->qdepth - 2;
 
 	usb_set_intfdata(intf, shost);
 	result = scsi_add_host(shost, &intf->dev);
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-23 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-23 16:02 [PATCH 1/1] uas: leave can_queue as MAX_CMNDS if device reports larger qdepth tom.ty89
2016-05-23 17:00 ` Greg KH
2016-05-23 17:23   ` Tom Yan
2016-05-23 17:27     ` James Bottomley
2016-05-23 18:33       ` Tom Yan
2016-05-23 19:07         ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox