public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PCI: Don't assume root ports from > 2015 are power manageable
@ 2023-05-17 15:08 Mario Limonciello
  2023-05-22  5:55 ` Mika Westerberg
  2023-05-23 20:35 ` Bjorn Helgaas
  0 siblings, 2 replies; 7+ messages in thread
From: Mario Limonciello @ 2023-05-17 15:08 UTC (permalink / raw)
  To: Bjorn Helgaas, Mika Westerberg
  Cc: linux-pci, linux-kernel, S-k Shyam-sundar, Natikar Basavaraj,
	Deucher Alexander, Mario Limonciello, Iain Lane

Using an XHCI device to wakeup the system from s2idle fails when
that XHCI device is connected to a USB-C port for an AMD USB4
router.

Due to commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during
suspend") all root port go into D3 during s2idle.
When the root ports are in D3 over s2idle it's not possible for the
platform firmware to properly identify the wakeup source.

Comparing registers between Linux and Windows 11 this behavior to put root
ports into D3 at suspend is unique to Linux.  On an affected system
Windows does not put the root ports into D3 over Modern Standby.

Windows doesn't put the root ports into D3 because root ports are not
power manageable; they're missing _PRW and _S0W.

Linux shouldn't be assuming they support D3 just because they're newer
than 2015, the ports should also be deemed power manageable.
Add an extra check for this to ensure D3 isn't selected for such machines.

Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
Reported-by: Iain Lane <iain@orangesquash.org.uk>
Closes: https://forums.lenovo.com/t5/Ubuntu/Z13-can-t-resume-from-suspend-with-external-USB-keyboard/m-p/5217121
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/pci/pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 5ede93222bc1..3fe27aef09e6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3010,6 +3010,9 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
 		if (dmi_check_system(bridge_d3_blacklist))
 			return false;
 
+		if (!platform_pci_power_manageable(bridge))
+			return false;
+
 		/*
 		 * It should be safe to put PCIe ports from 2015 or newer
 		 * to D3.
-- 
2.34.1


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

end of thread, other threads:[~2023-05-24 10:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 15:08 [PATCH v2] PCI: Don't assume root ports from > 2015 are power manageable Mario Limonciello
2023-05-22  5:55 ` Mika Westerberg
2023-05-22 11:28   ` Mario Limonciello
2023-05-22 11:40     ` Mika Westerberg
2023-05-23 20:35 ` Bjorn Helgaas
2023-05-23 21:29   ` Limonciello, Mario
2023-05-24 10:17     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox