On 7/17/23 21:54, Christoph Hellwig wrote:
On Mon, Jul 17, 2023 at 01:52:15PM -0700, Bart Van Assche wrote:
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -329,6 +329,9 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev)
starget->starget_sdev_user = NULL;
spin_unlock_irqrestore(shost->host_lock, flags);
+ /* Combining BLIST_SINGLELUN with BLK_MQ_F_BLOCKING is not supported. */
+ WARN_ON_ONCE(shost->tag_set.flags & BLK_MQ_F_BLOCKING);
.. but it must work. BLIST_SINGLELUN is set for specific targets
based on the identification string while BLK_MQ_F_BLOCKING is set by
the LLDD. Also the blist flags can be set from userspace through
/proc/scsi/device_info.
Hi Christoph,
I think that support for BLIST_SINGLELUN devices can be realized with the
change shown below. I had not yet looked into this because my understanding
is that BLIST_SINGLELUN devices are all CD-ROM devices that are probably
rare these days.
Bart.
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 197942db8016..84fb0feb047f 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -329,16 +329,14 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev)
starget->starget_sdev_user = NULL;
spin_unlock_irqrestore(shost->host_lock, flags);
- /* Combining BLIST_SINGLELUN with BLK_MQ_F_BLOCKING is not supported. */
- WARN_ON_ONCE(shost->tag_set.flags & BLK_MQ_F_BLOCKING);
-
/*
* Call blk_run_queue for all LUNs on the target, starting with
* current_sdev. We race with others (to set starget_sdev_user),
* but in most cases, we will be first. Ideally, each LU on the
* target would get some limited time or requests on the target.
*/
- blk_mq_run_hw_queues(current_sdev->request_queue, false);
+ blk_mq_run_hw_queues(current_sdev->request_queue,
+ shost->queuecommand_may_block);
spin_lock_irqsave(shost->host_lock, flags);
if (!starget->starget_sdev_user)