[Bionic][PATCH v3 19/21] scsi: core: introduce force_blk_mq
Jose Ricardo Ziviani
joserz at linux.vnet.ibm.com
Tue May 15 13:03:22 UTC 2018
From: Ming Lei <ming.lei at redhat.com>
BugLink: http://bugs.launchpad.net/bugs/1759723
This patch introduces 'force_blk_mq' to the scsi_host_template so that
drivers that have no desire to support the legacy I/O path can signal
blk-mq only support.
[mkp: commit desc]
Cc: Omar Sandoval <osandov at fb.com>,
Cc: "Martin K. Petersen" <martin.petersen at oracle.com>,
Cc: James Bottomley <james.bottomley at hansenpartnership.com>,
Cc: Christoph Hellwig <hch at lst.de>,
Cc: Don Brace <don.brace at microsemi.com>
Cc: Kashyap Desai <kashyap.desai at broadcom.com>
Cc: Mike Snitzer <snitzer at redhat.com>
Cc: Laurence Oberman <loberman at redhat.com>
Signed-off-by: Ming Lei <ming.lei at redhat.com>
Reviewed-by: Hannes Reinecke <hare at suse.de>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
(cherry picked from commit 2f31115e940c4afd49b99c33123534e2ac924ffb)
Signed-off-by: Jose Ricardo Ziviani <joserz at linux.ibm.com>
---
drivers/scsi/hosts.c | 1 +
include/scsi/scsi_host.h | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index dd9464920456..ef22b275d050 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -474,6 +474,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
shost->dma_boundary = 0xffffffff;
shost->use_blk_mq = scsi_use_blk_mq;
+ shost->use_blk_mq = scsi_use_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 a8b7bf879ced..9c1e4bad6581 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -452,6 +452,9 @@ struct scsi_host_template {
/* True if the controller does not support WRITE SAME */
unsigned no_write_same:1;
+ /* True if the low-level driver supports blk-mq only */
+ unsigned force_blk_mq:1;
+
/*
* Countdown for host blocking with no commands outstanding.
*/
--
2.17.0
More information about the kernel-team
mailing list