Johannes Thumshirn 95c5d4
From: Sagi Grimberg <sagi@grimberg.me>
Johannes Thumshirn 95c5d4
Date: Mon, 10 Jul 2017 09:22:29 +0300
Johannes Thumshirn 95c5d4
Subject: nvme: Add admin_tagset pointer to nvme_ctrl
Johannes Thumshirn 95c5d4
Patch-mainline: v4.14-rc1
Johannes Thumshirn 95c5d4
Git-commit: 34b6c2315eb66e6411261aa440f6e3c4cded3506
Johannes Thumshirn 95c5d4
References: FATE#323952, FATE#322506
Johannes Thumshirn 95c5d4
Johannes Thumshirn 95c5d4
Will be used when we centralize control flows.
Johannes Thumshirn 95c5d4
Johannes Thumshirn 95c5d4
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Johannes Thumshirn 95c5d4
Signed-off-by: Christoph Hellwig <hch@lst.de>
Johannes Thumshirn 95c5d4
Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
Johannes Thumshirn 95c5d4
---
Johannes Thumshirn 95c5d4
 drivers/nvme/host/fc.c     |    1 +
Johannes Thumshirn 95c5d4
 drivers/nvme/host/nvme.h   |    1 +
Johannes Thumshirn 95c5d4
 drivers/nvme/host/pci.c    |    1 +
Johannes Thumshirn 95c5d4
 drivers/nvme/host/rdma.c   |    1 +
Johannes Thumshirn 95c5d4
 drivers/nvme/target/loop.c |    1 +
Johannes Thumshirn 95c5d4
 5 files changed, 5 insertions(+)
Johannes Thumshirn 95c5d4
Johannes Thumshirn 95c5d4
--- a/drivers/nvme/host/fc.c
Johannes Thumshirn 95c5d4
+++ b/drivers/nvme/host/fc.c
Johannes Thumshirn 95c5d4
@@ -2731,6 +2731,7 @@ nvme_fc_init_ctrl(struct device *dev, st
Johannes Thumshirn 95c5d4
 	ret = blk_mq_alloc_tag_set(&ctrl->admin_tag_set);
Johannes Thumshirn 95c5d4
 	if (ret)
Johannes Thumshirn 95c5d4
 		goto out_free_queues;
Johannes Thumshirn 95c5d4
+	ctrl->ctrl.admin_tagset = &ctrl->admin_tag_set;
Johannes Thumshirn 95c5d4
 
Johannes Thumshirn 95c5d4
 	ctrl->ctrl.admin_q = blk_mq_init_queue(&ctrl->admin_tag_set);
Johannes Thumshirn 95c5d4
 	if (IS_ERR(ctrl->ctrl.admin_q)) {
Johannes Thumshirn 95c5d4
--- a/drivers/nvme/host/nvme.h
Johannes Thumshirn 95c5d4
+++ b/drivers/nvme/host/nvme.h
Johannes Thumshirn 95c5d4
@@ -125,6 +125,7 @@ struct nvme_ctrl {
Johannes Thumshirn 95c5d4
 	struct kref kref;
Johannes Thumshirn 95c5d4
 	int instance;
Johannes Thumshirn 95c5d4
 	struct blk_mq_tag_set *tagset;
Johannes Thumshirn 95c5d4
+	struct blk_mq_tag_set *admin_tagset;
Johannes Thumshirn 95c5d4
 	struct list_head namespaces;
Johannes Thumshirn 95c5d4
 	struct mutex namespaces_mutex;
Johannes Thumshirn 95c5d4
 	struct device *device;	/* char device */
Johannes Thumshirn 95c5d4
--- a/drivers/nvme/host/pci.c
Johannes Thumshirn 95c5d4
+++ b/drivers/nvme/host/pci.c
Johannes Thumshirn 95c5d4
@@ -1377,6 +1377,7 @@ static int nvme_alloc_admin_tags(struct
Johannes Thumshirn 95c5d4
 
Johannes Thumshirn 95c5d4
 		if (blk_mq_alloc_tag_set(&dev->admin_tagset))
Johannes Thumshirn 95c5d4
 			return -ENOMEM;
Johannes Thumshirn 95c5d4
+		dev->ctrl.admin_tagset = &dev->admin_tagset;
Johannes Thumshirn 95c5d4
 
Johannes Thumshirn 95c5d4
 		dev->ctrl.admin_q = blk_mq_init_queue(&dev->admin_tagset);
Johannes Thumshirn 95c5d4
 		if (IS_ERR(dev->ctrl.admin_q)) {
Johannes Thumshirn 95c5d4
--- a/drivers/nvme/host/rdma.c
Johannes Thumshirn 95c5d4
+++ b/drivers/nvme/host/rdma.c
Johannes Thumshirn 95c5d4
@@ -698,6 +698,7 @@ static int nvme_rdma_configure_admin_que
Johannes Thumshirn 95c5d4
 	error = blk_mq_alloc_tag_set(&ctrl->admin_tag_set);
Johannes Thumshirn 95c5d4
 	if (error)
Johannes Thumshirn 95c5d4
 		goto out_put_dev;
Johannes Thumshirn 95c5d4
+	ctrl->ctrl.admin_tagset = &ctrl->admin_tag_set;
Johannes Thumshirn 95c5d4
 
Johannes Thumshirn 95c5d4
 	ctrl->ctrl.admin_q = blk_mq_init_queue(&ctrl->admin_tag_set);
Johannes Thumshirn 95c5d4
 	if (IS_ERR(ctrl->ctrl.admin_q)) {
Johannes Thumshirn 95c5d4
--- a/drivers/nvme/target/loop.c
Johannes Thumshirn 95c5d4
+++ b/drivers/nvme/target/loop.c
Johannes Thumshirn 95c5d4
@@ -375,6 +375,7 @@ static int nvme_loop_configure_admin_que
Johannes Thumshirn 95c5d4
 	error = blk_mq_alloc_tag_set(&ctrl->admin_tag_set);
Johannes Thumshirn 95c5d4
 	if (error)
Johannes Thumshirn 95c5d4
 		goto out_free_sq;
Johannes Thumshirn 95c5d4
+	ctrl->ctrl.admin_tagset = &ctrl->admin_tag_set;
Johannes Thumshirn 95c5d4
 
Johannes Thumshirn 95c5d4
 	ctrl->ctrl.admin_q = blk_mq_init_queue(&ctrl->admin_tag_set);
Johannes Thumshirn 95c5d4
 	if (IS_ERR(ctrl->ctrl.admin_q)) {