Commit 7dbbf0fa authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: scsi-mq: Wait for .queue_rq() if necessary

Ensure that if scsi-mq is enabled that scsi_internal_device_block()
waits until ongoing shost->hostt->queuecommand() calls have finished.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Cc: James Bottomley <jejb@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Doug Ledford <dledford@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d2a14525
...@@ -2893,7 +2893,7 @@ scsi_internal_device_block(struct scsi_device *sdev) ...@@ -2893,7 +2893,7 @@ scsi_internal_device_block(struct scsi_device *sdev)
* request queue. * request queue.
*/ */
if (q->mq_ops) { if (q->mq_ops) {
blk_mq_stop_hw_queues(q); blk_mq_quiesce_queue(q);
} else { } else {
spin_lock_irqsave(q->queue_lock, flags); spin_lock_irqsave(q->queue_lock, flags);
blk_stop_queue(q); blk_stop_queue(q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment