On Sun, Nov 17, 2019 at 09:30:39PM -0800, Bart Van Assche wrote: > On 2019-11-17 00:08, Ming Lei wrote: > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > > index 379533ce8661..212903d5f43c 100644 > > --- a/drivers/scsi/scsi_lib.c > > +++ b/drivers/scsi/scsi_lib.c > > @@ -612,7 +612,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error, > > if (scsi_target(sdev)->single_lun || > > !list_empty(&sdev->host->starved_list)) > > kblockd_schedule_work(&sdev->requeue_work); > > - else > > + else if (READ_ONCE(sdev->restart)) > > blk_mq_run_hw_queues(q, true); > > > > Rerunning the hardware queues is not only necessary after > scsi_dev_queue_ready() returns false but also after .queuecommand() > returns SCSI_MLQUEUE_*_BUSY. Can this patch cause queue stalls if > .queuecommand() returns SCSI_MLQUEUE_*_BUSY? No, that isn't why blk_mq_run_hw_queues is called in scsi_end_request(), and you should see that it is just this LUN to be re-run. Also if .queuecommand() returns any non-zero value, BLK_STS_RESOURCE will be returned to blk-mq, then blk-mq will cover the re-run. thanks, Ming