public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <kch@nvidia.com>
To: <linux-nvme@lists.infradead.org>, <linux-pm@vger.kernel.org>
Cc: <rafael@kernel.org>, <len.brown@intel.com>, <pavel@ucw.cz>,
	<gregkh@linuxfoundation.org>, <kbusch@kernel.org>, <hch@lst.de>,
	<sagi@grimberg.me>, Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH 2/3] nvme-core: init fault injection & mpath ctrl early
Date: Tue, 1 Aug 2023 20:26:28 -0700	[thread overview]
Message-ID: <20230802032629.24309-3-kch@nvidia.com> (raw)
In-Reply-To: <20230802032629.24309-1-kch@nvidia.com>

In order to avoid any initialization after cdev_device_add() move fault
injection and multipath ctrl initialization before cdev_device_add().

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index a732a862d6bf..555ec4af5b80 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4465,6 +4465,8 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
 	if (ret)
 		goto out_release_instance;
 
+	nvme_fault_inject_init(&ctrl->fault_inject, dev_name(ctrl->device));
+	nvme_mpath_init_ctrl(ctrl);
 	nvme_get_ctrl(ctrl);
 	cdev_init(&ctrl->cdev, &nvme_dev_fops);
 	ctrl->cdev.owner = ops->module;
@@ -4480,8 +4482,6 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
 	dev_pm_qos_update_user_latency_tolerance(ctrl->device,
 		min(default_ps_max_latency_us, (unsigned long)S32_MAX));
 
-	nvme_fault_inject_init(&ctrl->fault_inject, dev_name(ctrl->device));
-	nvme_mpath_init_ctrl(ctrl);
 	return 0;
 
 out_free_name:
-- 
2.40.0



  parent reply	other threads:[~2023-08-02  3:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  3:26 [PATCH 0/3] nvme-core: restructure nvme_init_ctrl() Chaitanya Kulkarni
2023-08-02  3:26 ` [PATCH 1/3] nvme-core: init auth ctrl early Chaitanya Kulkarni
2023-08-02  3:26 ` Chaitanya Kulkarni [this message]
2023-08-02  3:26 ` [PATCH 3/3] nvme-core: init power qoe ops early Chaitanya Kulkarni
2023-08-02 12:27 ` [PATCH 0/3] nvme-core: restructure nvme_init_ctrl() Christoph Hellwig

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=20230802032629.24309-3-kch@nvidia.com \
    --to=kch@nvidia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=sagi@grimberg.me \
    /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