nvme-pci: add support for ACPI StorageD3Enable property
authorDavid E. Box <david.e.box@linux.intel.com>
Thu, 9 Jul 2020 18:43:33 +0000 (11:43 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 29 Jul 2020 05:45:19 +0000 (07:45 +0200)
commitdf4f9bc4fb9cb338b1c21cf99c6e905d3b78e91d
tree689a8b38ce7465e69bef4fc52e990cce02ed4704
parentb13c6393be7dfa780835fd4400d16d0ec1cf128f
nvme-pci: add support for ACPI StorageD3Enable property

This patch implements a solution for a BIOS hack used on some currently
shipping Intel systems to change driver power management policy for PCIe
NVMe drives. Some newer Intel platforms, like some Comet Lake systems,
require that PCIe devices use D3 when doing suspend-to-idle in order to
allow the platform to realize maximum power savings. This is particularly
needed to support ATX power supply shutdown on desktop systems. In order to
ensure this happens for root ports with storage devices, Microsoft
apparently created this ACPI _DSD property as a way to influence their
driver policy. To my knowledge this property has not been discussed with
the NVME specification body.

Though the solution is not ideal, it addresses a problem that also affects
Linux since the NVMe driver's default policy of using NVMe APST during
suspend-to-idle prevents the PCI root port from going to D3 and leads to
higher power consumption for these platforms. The power consumption
difference may be negligible on laptop systems, but many watts on desktop
systems when the ATX power supply is blocked from powering down.

The patch creates a new nvme_acpi_storage_d3 function to check for the
StorageD3Enable property during probe and enables D3 as a quirk if set.  It
also provides a 'noacpi' module parameter to allow skipping the quirk if
needed.

Tested with:
 - PM961 NVMe SED Samsung 512GB
 - INTEL SSDPEKKF512G8

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@linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/acpi/property.c
drivers/nvme/host/pci.c