[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200428003214.3764-3-david.e.box@linux.intel.com>
Date: Mon, 27 Apr 2020 17:32:14 -0700
From: "David E. Box" <david.e.box@...ux.intel.com>
To: rjw@...ysocki.net, lenb@...nel.org, bhelgaas@...gle.com,
kbusch@...nel.org, axboe@...com, hch@....de, sagi@...mberg.me
Cc: "David E. Box" <david.e.box@...ux.intel.com>,
linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
Dan Williams <dan.j.williams@...el.com>
Subject: [PATCH 2/2] drivers/nvme: Add support for ACPI StorageD3Enable property
NVMe storage power management during suspend-to-idle, particularly on
laptops, has been inconsistent with some devices working with D3 while
others must rely on NVMe APST in order for power savings to be realized.
Currently the default is to use APST unless quirked to do otherwise.
However newer platforms, like Intel Comet Lake systems, may require NVMe
drives to use D3 in order for the PCIe ports to be properly power managed.
To make it easier for drivers to choose, these platforms may supply a
special "StorageD3Enable" _DSD property under the root port that the device
is attached to. If supplied, the driver must use D3 in order for the
platform to realize the deepest power savings in suspend-to-idle.
Add check of StorageD3Enable property during probe to use D3 as specified
by platform firmware.
Acked-by: Dan Williams <dan.j.williams@...el.com>
Link: https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/power-management-for-storage-hardware-devices-intro
Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
---
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 4e79e412b276..4d67735975f6 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2777,6 +2777,13 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
quirks |= check_vendor_combination_bug(pdev);
+ /*
+ * Platform requires storage device to use D3 for kernel managed
+ * suspend.
+ */
+ if (pdev->storage_d3)
+ quirks |= NVME_QUIRK_SIMPLE_SUSPEND;
+
/*
* Double check that our mempool alloc size will cover the biggest
* command we support.
--
2.20.1
Powered by blists - more mailing lists