public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>
Cc: James Smart <james.smart@broadcom.com>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>,
	asahi@lists.linux.dev, linux-nvme@lists.infradead.org
Subject: [PATCH 7/9] nvme-pci: rename nvme_disable_io_queues
Date: Tue, 29 Nov 2022 14:22:06 +0100	[thread overview]
Message-ID: <20221129132208.4337-8-hch@lst.de> (raw)
In-Reply-To: <20221129132208.4337-1-hch@lst.de>

This function really deletes the I/O queues, so rename it to match
the functionality.  Also move the main wrapper right next to the
actual underlying implementation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/pci.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 2c8dd0f7ef463b..1b527377e35197 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -109,7 +109,7 @@ struct nvme_dev;
 struct nvme_queue;
 
 static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown);
-static bool __nvme_disable_io_queues(struct nvme_dev *dev, u8 opcode);
+static void nvme_delete_io_queues(struct nvme_dev *dev);
 
 /*
  * Represents an NVM Express device.  Each nvme_dev is a PCI function.
@@ -2310,12 +2310,6 @@ static int nvme_setup_irqs(struct nvme_dev *dev, unsigned int nr_io_queues)
 			      PCI_IRQ_ALL_TYPES | PCI_IRQ_AFFINITY, &affd);
 }
 
-static void nvme_disable_io_queues(struct nvme_dev *dev)
-{
-	if (__nvme_disable_io_queues(dev, nvme_admin_delete_sq))
-		__nvme_disable_io_queues(dev, nvme_admin_delete_cq);
-}
-
 static unsigned int nvme_max_io_queues(struct nvme_dev *dev)
 {
 	/*
@@ -2423,7 +2417,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
 
 	if (dev->online_queues - 1 < dev->max_qid) {
 		nr_io_queues = dev->online_queues - 1;
-		nvme_disable_io_queues(dev);
+		nvme_delete_io_queues(dev);
 		result = nvme_setup_io_queues_trylock(dev);
 		if (result)
 			return result;
@@ -2487,7 +2481,7 @@ static int nvme_delete_queue(struct nvme_queue *nvmeq, u8 opcode)
 	return 0;
 }
 
-static bool __nvme_disable_io_queues(struct nvme_dev *dev, u8 opcode)
+static bool __nvme_delete_io_queues(struct nvme_dev *dev, u8 opcode)
 {
 	int nr_queues = dev->online_queues - 1, sent = 0;
 	unsigned long timeout;
@@ -2515,6 +2509,12 @@ static bool __nvme_disable_io_queues(struct nvme_dev *dev, u8 opcode)
 	return true;
 }
 
+static void nvme_delete_io_queues(struct nvme_dev *dev)
+{
+	if (__nvme_delete_io_queues(dev, nvme_admin_delete_sq))
+		__nvme_delete_io_queues(dev, nvme_admin_delete_cq);
+}
+
 static void nvme_pci_alloc_tag_set(struct nvme_dev *dev)
 {
 	struct blk_mq_tag_set * set = &dev->tagset;
@@ -2687,7 +2687,7 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
 	nvme_quiesce_io_queues(&dev->ctrl);
 
 	if (!dead && dev->ctrl.queue_count > 0) {
-		nvme_disable_io_queues(dev);
+		nvme_delete_io_queues(dev);
 		nvme_disable_ctrl(&dev->ctrl, shutdown);
 		nvme_poll_irqdisable(&dev->queues[0]);
 	}
-- 
2.30.2



  parent reply	other threads:[~2022-11-29 13:22 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 13:21 remove path cleanups Christoph Hellwig
2022-11-29 13:22 ` [PATCH 1/9] nvme-apple: fix controller shutdown in apple_nvme_disable Christoph Hellwig
2022-11-29 15:41   ` Hector Martin
2023-01-10 17:47     ` Janne Grunau
2023-01-11  4:09       ` Hector Martin
2023-01-11  9:30       ` Linux kernel regression tracking (#adding)
2022-12-06 10:37   ` Eric Curtin
2022-12-06 12:15   ` Sagi Grimberg
2022-11-29 13:22 ` [PATCH 2/9] nvme: use nvme_wait_ready in nvme_shutdown_ctrl Christoph Hellwig
2022-11-29 15:57   ` Pankaj Raghav
2022-11-30 13:57     ` Christoph Hellwig
2022-11-30 14:27       ` Pankaj Raghav
2022-11-30 16:15         ` Keith Busch
2022-12-06 13:33         ` Christoph Hellwig
2022-11-29 13:22 ` [PATCH 3/9] nvme: merge nvme_shutdown_ctrl into nvme_disable_ctrl Christoph Hellwig
2022-11-29 15:44   ` Hector Martin
2022-12-06 12:18   ` Sagi Grimberg
2022-11-29 13:22 ` [PATCH 4/9] nvme-pci: remove nvme_disable_admin_queue Christoph Hellwig
2022-12-06 10:38   ` Eric Curtin
2022-12-06 12:18   ` Sagi Grimberg
2022-11-29 13:22 ` [PATCH 5/9] nvme-pci: remove nvme_pci_disable Christoph Hellwig
2022-12-06 10:39   ` Eric Curtin
2022-12-06 12:19   ` Sagi Grimberg
2022-11-29 13:22 ` [PATCH 6/9] nvme-pci: cleanup nvme_suspend_queue Christoph Hellwig
2022-12-06 12:20   ` Sagi Grimberg
2022-11-29 13:22 ` Christoph Hellwig [this message]
2022-12-06 12:21   ` [PATCH 7/9] nvme-pci: rename nvme_disable_io_queues Sagi Grimberg
2022-11-29 13:22 ` [PATCH 8/9] nvme-pci: return early on ctrl state mismatch in nvme_reset_work Christoph Hellwig
2022-12-06 11:26   ` Keith Busch
2022-12-06 13:38     ` Christoph Hellwig
2022-12-06 12:21   ` Sagi Grimberg
2022-11-29 13:22 ` [PATCH 9/9] nvme-pci: split out a nvme_pci_ctrl_is_dead helper Christoph Hellwig
2022-12-06 12:23   ` Sagi Grimberg
2022-12-06  8:18 ` remove path cleanups Christoph Hellwig
2022-12-06 11:26 ` Keith Busch

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=20221129132208.4337-8-hch@lst.de \
    --to=hch@lst.de \
    --cc=asahi@lists.linux.dev \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=marcan@marcan.st \
    --cc=sagi@grimberg.me \
    --cc=sven@svenpeter.dev \
    /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