From: "Heyne, Maximilian" <mheyne@amazon.de>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: "Heyne, Maximilian" <mheyne@amazon.de>,
Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
Sagi Grimberg <sagi@grimberg.me>,
"Chaitanya Kulkarni" <kch@nvidia.com>,
Jens Axboe <axboe@kernel.dk>, Hector Martin <marcan@marcan.st>,
Sven Peter <sven@svenpeter.dev>,
Alyssa Rosenzweig <alyssa@rosenzweig.io>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
Sasha Levin <sashal@kernel.org>,
Peter Wang <peter.wang@mediatek.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Yen <thomasyen@google.com>,
Brian Kao <powenkao@google.com>,
"Sanjeev Yadav" <sanjeev.y@mediatek.com>,
Wonkon Kim <wkon.kim@samsung.com>,
"Seunghui Lee" <sh043.lee@samsung.com>,
Ming Lei <ming.lei@redhat.com>, Hannes Reinecke <hare@suse.de>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"asahi@lists.linux.dev" <asahi@lists.linux.dev>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: [PATCH 6.1.y v2 4/6] nvme-pci: put the admin queue in nvme_dev_remove_admin
Date: Thu, 2 Apr 2026 13:57:18 +0000 [thread overview]
Message-ID: <20260402-kemp-dime-b84f5127@mheyne-amazon> (raw)
In-Reply-To: <20260402-moral-jockey-f072379b@mheyne-amazon>
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 96ef1be53663a9343dffcf106e2f1b59da4b8799 ]
Once the controller is shutdown no one can access the admin queue. Tear
it down in nvme_dev_remove_admin, which matches the flow in the other
drivers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Tested-by Gerd Bayer <gbayer@linxu.ibm.com>
Stable-dep-of: 03b3bcd319b3 ("nvme: fix admin request_queue lifetime")
[ Context change due to missing commit 94cc781f69f4 ("nvme: move OPAL
setup from PCIe to core")]
Signed-off-by: Maximilian Heyne <mheyne@amazon.de>
---
drivers/nvme/host/pci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 13c0098939ec0..38732c0c28bbb 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1782,6 +1782,7 @@ static void nvme_dev_remove_admin(struct nvme_dev *dev)
*/
nvme_start_admin_queue(&dev->ctrl);
blk_mq_destroy_queue(dev->ctrl.admin_q);
+ blk_put_queue(dev->ctrl.admin_q);
blk_mq_free_tag_set(&dev->admin_tagset);
}
}
@@ -2831,8 +2832,6 @@ static void nvme_pci_free_ctrl(struct nvme_ctrl *ctrl)
nvme_dbbuf_dma_free(dev);
nvme_free_tagset(dev);
- if (dev->ctrl.admin_q)
- blk_put_queue(dev->ctrl.admin_q);
free_opal_dev(dev->ctrl.opal_dev);
mempool_destroy(dev->iod_mempool);
put_device(dev->dev);
--
2.50.1
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
next prev parent reply other threads:[~2026-04-02 13:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 13:57 [PATCH 6.1.y v2 0/6] nvme: correctly fix admin request_queue lifetime Heyne, Maximilian
2026-04-02 13:57 ` [PATCH 6.1.y v2 1/6] Revert "nvme: fix admin request_queue lifetime" Heyne, Maximilian
2026-04-02 13:57 ` [PATCH 6.1.y v2 2/6] blk-mq: move the call to blk_put_queue out of blk_mq_destroy_queue Heyne, Maximilian
2026-04-02 13:57 ` [PATCH 6.1.y v2 3/6] nvme-pci: remove an extra queue reference Heyne, Maximilian
2026-04-02 13:57 ` Heyne, Maximilian [this message]
2026-04-02 13:57 ` [PATCH 6.1.y v2 5/6] nvme: fix admin request_queue lifetime Heyne, Maximilian
2026-04-02 13:57 ` [PATCH 6.1.y v2 6/6] nvme: fix admin queue leak on controller reset Heyne, Maximilian
2026-04-03 9:43 ` Fedor Pchelkin
2026-04-03 9:48 ` [PATCH 6.1.y v2 0/6] nvme: correctly fix admin request_queue lifetime Fedor Pchelkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260402-kemp-dime-b84f5127@mheyne-amazon \
--to=mheyne@amazon.de \
--cc=alim.akhtar@samsung.com \
--cc=alyssa@rosenzweig.io \
--cc=asahi@lists.linux.dev \
--cc=avri.altman@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=gregkh@linuxfoundation.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jejb@linux.ibm.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=marcan@marcan.st \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=peter.wang@mediatek.com \
--cc=powenkao@google.com \
--cc=sagi@grimberg.me \
--cc=sanjeev.y@mediatek.com \
--cc=sashal@kernel.org \
--cc=sh043.lee@samsung.com \
--cc=stable@vger.kernel.org \
--cc=sven@svenpeter.dev \
--cc=thomasyen@google.com \
--cc=wkon.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox