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 3/3] nvme-core: init power qoe ops early
Date: Tue, 1 Aug 2023 20:26:29 -0700 [thread overview]
Message-ID: <20230802032629.24309-4-kch@nvidia.com> (raw)
In-Reply-To: <20230802032629.24309-1-kch@nvidia.com>
In order to avoid any initialization after cdev_device_add() move
dev pm qos latency tolerance before cdev_device_add().
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
drivers/nvme/host/core.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 555ec4af5b80..cd27df7a5751 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4465,6 +4465,14 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
if (ret)
goto out_release_instance;
+ /*
+ * Initialize latency tolerance controls. The sysfs files won't
+ * be visible to userspace unless the device actually supports APST.
+ */
+ ctrl->device->power.set_latency_tolerance = nvme_set_latency_tolerance;
+ 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);
nvme_get_ctrl(ctrl);
@@ -4474,14 +4482,6 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
if (ret)
goto out_free_name;
- /*
- * Initialize latency tolerance controls. The sysfs files won't
- * be visible to userspace unless the device actually supports APST.
- */
- ctrl->device->power.set_latency_tolerance = nvme_set_latency_tolerance;
- dev_pm_qos_update_user_latency_tolerance(ctrl->device,
- min(default_ps_max_latency_us, (unsigned long)S32_MAX));
-
return 0;
out_free_name:
--
2.40.0
next prev 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 ` [PATCH 2/3] nvme-core: init fault injection & mpath " Chaitanya Kulkarni
2023-08-02 3:26 ` Chaitanya Kulkarni [this message]
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-4-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;
as well as URLs for NNTP newsgroup(s).