Linux-NVME Archive on
 help / color / Atom feed
* [PATCH] nvme: Favor D3cold for suspend if NVMe device supports it
@ 2021-04-16  9:10 Kai-Heng Feng
  0 siblings, 0 replies; only message in thread
From: Kai-Heng Feng @ 2021-04-16  9:10 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi
  Cc: Kai-Heng Feng, Alex Deucher, Prike Liang, Shyam Sundar S K,
	open list:NVM EXPRESS DRIVER, open list

On AMD platforms that use s2idle, NVMe timeouts on s2idle resume,
because their SMU FW may cut off NVMe power during sleep.

Unlike Intel platforms where the power resources are generally
controlled by root port, the power resources is controlled by NVMe
device itself on recent AMD platforms:
    Scope (\_SB.PCI0.GP24.NVME)
        Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
        Name (_PR2, Package (0x01)  // _PR2: Power Resources for D2
        Name (_PR3, Package (0x01)  // _PR3: Power Resources for D3hot
        Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0

        Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
And it's a great indication that the NVMe should use D3cold for sleep
instead of staying at D0.

So use NVME_QUIRK_SIMPLE_SUSPEND if the ACPI counterpart of NVMe device
supports D3cold.

Tested on HP EliteBook 840 G7/G8.

Cc: Alex Deucher <>
Cc: Prike Liang <>
Cc: Shyam Sundar S K <>
Signed-off-by: Kai-Heng Feng <>
 drivers/nvme/host/pci.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 7249ae74f71f..cc190324a919 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2840,6 +2840,13 @@ static bool nvme_acpi_storage_d3(struct pci_dev *dev)
 	acpi_status status;
 	u8 val;
+	/*
+	 * If the device itself supports D3cold, use that instead of D0 ASPM +
+	 * NVMe APST.
+	 */
+	if (pci_pr3_present(dev))
+		return true;
 	 * Look for _DSD property specifying that the storage device on the port
 	 * must use D3 to support deep platform power savings during

Linux-nvme mailing list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16  9:10 [PATCH] nvme: Favor D3cold for suspend if NVMe device supports it Kai-Heng Feng

Linux-NVME Archive on

Archives are clonable:
	git clone --mirror linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ \
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone