nvme-pci: simple suspend quirk for vmd devices
Keith Busch
maintainerPATCH 1/1 nvme-pci: simple suspend quirk for vmd devices
Bug reports from users tell us platfroms with vmd enabled regressed power when using nvme power management on s2idle. We can't get the StorageD3Enable property on such devices so the driver used the wrong suspend method. Add a simple suspend quirk for the domain since that is the safest option.
--- drivers/nvme/host/pci.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/nvme/host/pci.c +6 -0
@@ -3094,6 +3094,12 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)dev_info (&pdev->dev,"platform quirk: setting simple suspend\n" ); quirks |=NVME_QUIRK_SIMPLE_SUSPEND ; + }else if (pci_domain_nr (pdev->bus) >0xffff ) { +/* +* ACPI device properties are not reliable within VMD domains, +* so assume the worst. +*/ + quirks |=NVME_QUIRK_SIMPLE_SUSPEND ; }/*
Signature · 1 line
2.25.4
Christoph Hellwig
maintainerdrivers/nvme/host/pci.c static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) · line 3102
Quoted 6 lines · Keith Busch
drivers/nvme/host/pci.c +6
-0+ }else if (pci_domain_nr (pdev->bus) >0xffff ) { +/* +* ACPI device properties are not reliable within VMD domains, +* so assume the worst. +*/ + quirks |=NVME_QUIRK_SIMPLE_SUSPEND ;
We'll need to communicate that from th vmd layer instead of hacking a check like this into NVMe..
Christoph Hellwig
maintainerQuoted 8 lines · Keith Busch
Bug reports from users tell us platfroms with vmd enabled regressed power when using nvme power management on s2idle. We can't get the StorageD3Enable property on such devices so the driver used the wrong suspend method. Add a simple suspend quirk for the domain since that is the safest option.
Cc "Rafael J. Wysocki" <[email protected]>
Rafael, can you try this on the affected platform? (not for merge as-is)
arch/x86/pci/common.c +1 -0
@@ -723,4 +723,5 @@ struct pci_dev *pci_real_dma_dev(struct pci_dev *dev) return dev; } +EXPORT_SYMBOL_GPL (pci_real_dma_dev);#endif
drivers/nvme/host/pci.c +1 -1
@@ -3086,7 +3086,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) quirks |=check_vendor_combination_bug (pdev); -if (!noacpi &&acpi_storage_d3 (&pdev->dev)) { +if (!noacpi &&acpi_storage_d3 (&pci_real_dma_dev (pdev)->dev)) {/* * Some systems use a bios work around to ask for D3 on * platforms that support kernel managed suspend.
Quoted 8 lines · Christoph Hellwig
Quoted 6 lines · Keith Busch
Bug reports from users tell us platfroms with vmd enabled regressed power when using nvme power management on s2idle. We can't get the StorageD3Enable property on such devices so the driver used the wrong suspend method. Add a simple suspend quirk for the domain since that is the safest option.
Quoted 5 lines
Quoted 2 lines
Cc "Rafael J. Wysocki" <[email protected]>Rafael, can you try this on the affected platform? (not for merge as-is)
I can't really do that myself (no access to the system in question), but I've just asked the original reporter (CCed) to do it.
Quoted 24 lines
arch/x86/pci/common.c +1
-0@@ -723,4 +723,5 @@ struct pci_dev *pci_real_dma_dev(struct pci_dev *dev) return dev; } +EXPORT_SYMBOL_GPL (pci_real_dma_dev);#endif drivers/nvme/host/pci.c +1
-1@@ -3086,7 +3086,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) quirks |=check_vendor_combination_bug (pdev); -if (!noacpi &&acpi_storage_d3 (&pdev->dev)) { +if (!noacpi &&acpi_storage_d3 (&pci_real_dma_dev (pdev)->dev)) {/* * Some systems use a bios work around to ask for D3 on * platforms that support kernel managed suspend.