linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: mq queue stall during command requeue
@ 2017-01-19 14:17 Hannes Reinecke
  2017-01-19 14:46 ` Christoph Hellwig
  2017-01-19 16:11 ` Bart Van Assche
  0 siblings, 2 replies; 7+ messages in thread
From: Hannes Reinecke @ 2017-01-19 14:17 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Johannes Thumshirn,
	linux-scsi, Hannes Reinecke, Hannes Reinecke

When we're hitting a busy condition in queuecommand() we need to
stop the hardware queue before calling blk_mq_delay_queue(); if
we don't blk_mq_delay_queue() will not do anything and requeue
will never triggered.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/scsi_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index e9e1e14..4b1cbc6 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1951,8 +1951,10 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
 	switch (ret) {
 	case BLK_MQ_RQ_QUEUE_BUSY:
 		if (atomic_read(&sdev->device_busy) == 0 &&
-		    !scsi_device_blocked(sdev))
+		    !scsi_device_blocked(sdev)) {
+			blk_mq_stop_hw_queue(hctx);
 			blk_mq_delay_queue(hctx, SCSI_QUEUE_DELAY);
+		}
 		break;
 	case BLK_MQ_RQ_QUEUE_ERROR:
 		/*
-- 
1.8.5.6


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

end of thread, other threads:[~2017-01-20  7:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19 14:17 [PATCH] scsi: mq queue stall during command requeue Hannes Reinecke
2017-01-19 14:46 ` Christoph Hellwig
2017-01-19 14:52   ` Hannes Reinecke
2017-01-19 14:58     ` Jens Axboe
2017-01-19 15:12       ` Christoph Hellwig
2017-01-19 16:11 ` Bart Van Assche
2017-01-20  7:24   ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).