All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] scsi: storvsc: Cap cmd_per_lun at can_queue
@ 2021-03-05 23:21 Melanie Plageman (Microsoft)
  2021-03-08 14:37 ` Michael Kelley
  0 siblings, 1 reply; 8+ messages in thread
From: Melanie Plageman (Microsoft) @ 2021-03-05 23:21 UTC (permalink / raw)
  To: linux-scsi
  Cc: andres, haiyangz, jejb, kys, linux-hyperv, linux-kernel,
	martin.petersen, mikelley, sthemmin, wei.liu,
	Melanie Plageman (Microsoft)

The scsi_device->queue_depth is set to Scsi_Host->cmd_per_lun during
allocation.

Cap cmd_per_lun at can_queue to avoid dispatch errors.

Signed-off-by: Melanie Plageman (Microsoft) <melanieplageman@gmail.com>
---
 drivers/scsi/storvsc_drv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 6bc5453cea8a..d7953a6e00e6 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1946,6 +1946,8 @@ static int storvsc_probe(struct hv_device *device,
 				(max_sub_channels + 1) *
 				(100 - ring_avail_percent_lowater) / 100;
 
+	scsi_driver.cmd_per_lun = min_t(u32, scsi_driver.cmd_per_lun, scsi_driver.can_queue);
+
 	host = scsi_host_alloc(&scsi_driver,
 			       sizeof(struct hv_host_device));
 	if (!host)
-- 
2.20.1


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

end of thread, other threads:[~2021-03-09 17:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 23:21 [PATCH v1] scsi: storvsc: Cap cmd_per_lun at can_queue Melanie Plageman (Microsoft)
2021-03-08 14:37 ` Michael Kelley
2021-03-08 17:56   ` Melanie Plageman
2021-03-09 10:09     ` John Garry
2021-03-09 15:57       ` Michael Kelley
2021-03-09 16:35         ` John Garry
2021-03-09 17:09           ` Michael Kelley
2021-03-09 15:45     ` Michael Kelley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.