• David E. Box's avatar
    nvme-pci: add support for ACPI StorageD3Enable property · df4f9bc4
    David E. Box authored
    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-introSigned-off-by: default avatarDavid E. Box <david.e.box@linux.intel.com>
    Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    df4f9bc4
pci.c 83.2 KB