All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: Forbid RPM on ACPI systems before 5.0 only
@ 2022-01-17 10:51 Heiner Kallweit
  2022-01-17 23:35 ` Bjorn Helgaas
  2022-01-18 16:28 ` Rafael J. Wysocki
  0 siblings, 2 replies; 9+ messages in thread
From: Heiner Kallweit @ 2022-01-17 10:51 UTC (permalink / raw)
  To: Bjorn Helgaas, Rafael J. Wysocki; +Cc: linux-pci, Linux PM

Currently PCI core forbids RPM and requires opt-in from userspace,
apart from few drivers calling pm_runtime_allow(). Reason is that some
early ACPI PM implementations conflict with RPM, see [0].
Note that as of today pm_runtime_forbid() is also called for non-ACPI
systems. Maybe it's time to allow RPM per default for non-ACPI systems
and recent enough ACPI versions. Let's allow RPM from ACPI 5.0 which
was published in 2011.

[0] https://lkml.org/lkml/2020/11/17/1548

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/pci/pci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 428afd459..26e3a500c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3101,7 +3101,12 @@ void pci_pm_init(struct pci_dev *dev)
 	u16 status;
 	u16 pmc;
 
-	pm_runtime_forbid(&dev->dev);
+#ifdef CONFIG_ACPI
+	/* Some early ACPI PM implementations conflict with RPM. */
+	if (acpi_gbl_FADT.header.revision > 0 &&
+	    acpi_gbl_FADT.header.revision < 5)
+		pm_runtime_forbid(&dev->dev);
+#endif
 	pm_runtime_set_active(&dev->dev);
 	pm_runtime_enable(&dev->dev);
 	device_enable_async_suspend(&dev->dev);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-01-19 19:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 10:51 [PATCH] PCI: Forbid RPM on ACPI systems before 5.0 only Heiner Kallweit
2022-01-17 23:35 ` Bjorn Helgaas
2022-01-18  8:06   ` Heiner Kallweit
2022-01-18 16:09     ` Bjorn Helgaas
2022-01-18 16:28 ` Rafael J. Wysocki
2022-01-18 16:56   ` Heiner Kallweit
2022-01-18 17:11     ` Rafael J. Wysocki
2022-01-18 17:42       ` Heiner Kallweit
2022-01-19 19:38         ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.