linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme/pci: default to simple suspend
@ 2022-02-01 16:50 Keith Busch
  2022-02-01 17:49 ` Vidya Sagar
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Keith Busch @ 2022-02-01 16:50 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, sagi, Keith Busch, Rafael Wysocki, Vidya Sagar

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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-04-23  5:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01 16:50 [PATCH] nvme/pci: default to simple suspend Keith Busch
2022-02-01 17:49 ` 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

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).