From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 263CCB67E; Wed, 8 Apr 2026 18:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672336; cv=none; b=LYXZMCgv0MunrinV5k6bbOLyOIUsJ3FoJt8sE9JkCbn435udjeHU+xB1zqu/BqMKTFXlE1FgpSarWl7BS3cd8lWRPWp2I/nSnTzDVjEx68nFjFk0pRzn2q3IGzD2BCZKaIJTyMemH8NG3sNU56KQN4oXnXmnB3ex76MAFK6FPsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672336; c=relaxed/simple; bh=aYaYOiEK7G9TAs9ZYhC09EWK+PvZH6ES+2uI2o/jHXw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZUzN6aICtqnDSdCmP2q6t/8oIrUkn8TnzUXKl+LaeI7dU2Cow/JH1QPxIW7Poy38aEws9MXswpPkA+RWc0ev4Ef7Cthp4SIcWarh6wemXukia3Bbcz8p6V+++HJsuEAPN4kH7qaCEK0X4kfDPpf3C4/WyBTebyX81HxRjzmxsQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DHBuDOwT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DHBuDOwT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88E63C19421; Wed, 8 Apr 2026 18:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775672336; bh=aYaYOiEK7G9TAs9ZYhC09EWK+PvZH6ES+2uI2o/jHXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DHBuDOwT2oKYTQ7TdknWzaEHMt3aBtHx4bZubjw2VZSiGhGR4l6Ns8T/Zv/DyrR0O kFQYvKI53j2M8Icx6SHI7UcxVeJROHAf1Hifn0yjuO1K2SZPc7kp/HRYfU9lae+kVs 7yoLOesVPnmy5UKYxaFmj6bJ+nq8p1BXdcDof/sA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christoph Hellwig , Keith Busch , Sagi Grimberg , Chaitanya Kulkarni , Maximilian Heyne , Fedor Pchelkin , Sasha Levin Subject: [PATCH 6.1 263/312] nvme-pci: put the admin queue in nvme_dev_remove_admin Date: Wed, 8 Apr 2026 20:03:00 +0200 Message-ID: <20260408175943.569306466@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175933.715315542@linuxfoundation.org> References: <20260408175933.715315542@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christoph Hellwig [ 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. Tested-by Gerd Bayer [ Context change due to missing commit 94cc781f69f4 ("nvme: move OPAL setup from PCIe to core")] Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Stable-dep-of: 03b3bcd319b3 ("nvme: fix admin request_queue lifetime") Signed-off-by: Maximilian Heyne Tested-by: Fedor Pchelkin Signed-off-by: Sasha Levin --- 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 04f7db2ff9cc2..8adce45f666c8 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1783,6 +1783,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); } } @@ -2838,8 +2839,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.53.0