From: Keith Busch <kbusch@kernel.org>
To: linux-nvme@lists.infradead.org
Cc: hch@lst.de, sagi@grimberg.me, Keith Busch <kbusch@kernel.org>,
Rafael Wysocki <rafael.j.wysocki@intel.com>,
Vidya Sagar <vidyas@nvidia.com>
Subject: [PATCH] nvme/pci: default to simple suspend
Date: Tue, 1 Feb 2022 08:50:06 -0800 [thread overview]
Message-ID: <20220201165006.3074615-1-kbusch@kernel.org> (raw)
There is no complete set of attributes a driver can check to know if
nvme power management is the correct thing to do in a runtime suspend
situation. Every attempt so far to optimize idle power consumption and
resume latency for a particular platform just leads to regressions
elsewhere.
Default to the simple shutdown since it is the historically safest
option, and provide a user parameter to override it if the user knows
it's safe to use for their platform.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215467
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com>
Cc: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/pci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index d8585df2c2fd..7e25cdef09a2 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -103,6 +103,10 @@ static bool noacpi;
module_param(noacpi, bool, 0444);
MODULE_PARM_DESC(noacpi, "disable acpi bios quirks");
+static bool pwr_mgmt;
+module_param(pwr_mgmt, bool, 0444);
+MODULE_PARM_DESC(pwr_mgmt, "use nvme power management for runtime suspend");
+
struct nvme_dev;
struct nvme_queue;
@@ -3094,7 +3098,8 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev_info(&pdev->dev,
"platform quirk: setting simple suspend\n");
quirks |= NVME_QUIRK_SIMPLE_SUSPEND;
- }
+ } else if (!pwr_mgmt)
+ quirks |= NVME_QUIRK_SIMPLE_SUSPEND;
/*
* Double check that our mempool alloc size will cover the biggest
--
2.25.4
next reply other threads:[~2022-02-01 16:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 16:50 Keith Busch [this message]
2022-02-01 17:49 ` [PATCH] nvme/pci: default to simple suspend Vidya Sagar
2022-02-02 7:55 ` Christoph Hellwig
2022-02-02 16:03 ` Keith Busch
2022-02-04 7:10 ` Christoph Hellwig
2022-02-07 16:06 ` Keith Busch
2022-02-08 14:37 ` Christoph Hellwig
2022-02-08 17:14 ` Keith Busch
2022-02-09 7:48 ` Christoph Hellwig
2022-04-11 13:58 ` Manivannan Sadhasivam
2022-04-23 5:49 ` 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=20220201165006.3074615-1-kbusch@kernel.org \
--to=kbusch@kernel.org \
--cc=hch@lst.de \
--cc=linux-nvme@lists.infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=sagi@grimberg.me \
--cc=vidyas@nvidia.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;
as well as URLs for NNTP newsgroup(s).