>From scsi driver view, it is a bit troublesome to support both
blk-mq and non-blk-mq at the same time, especially when drivers
start to support multi hw-queue.

This patch introduces 'force_blk_mq' to scsi_host_template
so that drivers can provide blk-mq only support, and avoid
to consider legacy support.

Signed-off-by: Ming Lei <ming....@canonical.com>
---
 drivers/scsi/hosts.c     |    3 ++-
 include/scsi/scsi_host.h |    3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 06030e1..d2b83f8 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -459,7 +459,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template 
*sht, int privsize)
        else
                shost->dma_boundary = 0xffffffff;
 
-       shost->use_blk_mq = scsi_use_blk_mq && !shost->hostt->disable_blk_mq;
+       shost->use_blk_mq = (scsi_use_blk_mq && !shost->hostt->disable_blk_mq)
+                               || shost->hostt->force_blk_mq;
 
        device_initialize(&shost->shost_gendev);
        dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 537c431..75c1468 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -514,6 +514,9 @@ struct scsi_host_template {
 
        /* temporary flag to disable blk-mq I/O path */
        bool disable_blk_mq;
+
+       /* tell scsi core we only support blk-mq */
+       bool force_blk_mq;
 };
 
 /*
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to