nvme: Look for StorageD3Enable on the actual acpi device as well as root port
PATCH 1/1 nvme: Look for StorageD3Enable on the actual acpi device as well as root port
The documentation around the StorageD3Enable property wasn't prescriptive on which device in the hierarchy should contain it.
The existing logic was intended for usage on Intel-based systems where the root port contained the StorageD3Enable property.
On AMD systems the StorageD3Enable property is directly on the device itself.
Suggested-by Prike Liang <[email protected]>
CC Shyam-sundar S-k <[email protected]>
CC Alexander Deucher <[email protected]>
CC Hans de Goede <[email protected]>
CC "Rafael J. Wysocki" <[email protected]>
Signed-off-by Mario Limonciello <[email protected]>
--- drivers/nvme/host/pci.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
drivers/nvme/host/pci.c +13 -4
@@ -2842,6 +2842,19 @@ static bool nvme_acpi_storage_d3(struct pci_dev *dev)* must use D3 to support deep platform power savings during * suspend-to-idle. */ + +/* First check the device itself for this property */ + adev =ACPI_COMPANION (&dev->dev); +if (adev) { +fwnode_property_read_u8 (acpi_fwnode_handle (adev),"StorageD3Enable" , &val); +if (val ==1 ) +return true; + } + +/* +* For Intel systems the property is defined in the PXSX device for South +* complex ports and in the PEGP device for North complex ports. +*/ root =pcie_find_root_port (dev);if (!root)return false;
@@ -2850,10 +2863,6 @@ static bool nvme_acpi_storage_d3(struct pci_dev *dev)if (!adev)return false; -/* -* The property is defined in the PXSX device for South complex ports -* and in the PEGP device for North complex ports. -*/ status =acpi_get_handle (adev->handle,"PXSX" , &handle);if (ACPI_FAILURE (status)) { status =acpi_get_handle (adev->handle,"PEGP" , &handle);
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerWe currently have a proposal on the list to only use the ACPI companion. Can you chime in there?
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme