[PATCH] nvme-pci: simple suspend quirk for vmd devices
Christoph Hellwig
hch at lst.de
Wed Feb 16 00:43:13 PST 2022
On Thu, Feb 10, 2022 at 07:22:33AM -0800, Keith Busch wrote:
> 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.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=215467
> Cc: "Rafael J. Wysocki" <rafael at kernel.org>
Rafael, can you try this on the affected platform?
(not for merge as-is)
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 9e1e6b8d88763..49f4e54da919d 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -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
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 6a99ed6809158..6edc8c514cbc8 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -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.
More information about the Linux-nvme
mailing list