[PATCH] nvme/pci: default to simple suspend

Keith Busch kbusch at kernel.org
Tue Feb 1 08:50:06 PST 2022


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 at intel.com>
Cc: Vidya Sagar <vidyas at nvidia.com>
Signed-off-by: Keith Busch <kbusch at 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




More information about the Linux-nvme mailing list