[+cc Rafael, Lukas, linux-pm]
On Wed, May 17, 2023 at 10:08:27AM -0500, Mario Limonciello wrote:
Using an XHCI device to wakeup the system from s2idle fails whenAre XHCI, USB-C, and the AMD USB4 router just examples?
that XHCI device is connected to a USB-C port for an AMD USB4
router.
I assume theBased on what's wrong with Linux and fixed by this patch,
same issue could happen with non-XHCI and non-AMD devices, too?
I assume the problem has something to do with PME_Support and some
device being put in a power state where it cannot generate or forward
PME messages? I think the PCIe protocol details would be helpful
here.
Comparing registers between Linux and Windows 11 this behavior to put rootplatform_pci_power_manageable() tests adev->flags.power_manageable,
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.
which is set by acpi_bus_get_power_flags() when a device has _PS0 or
_PR0.
So I don't know what's relevant out of _PRW, _S0W, _PS0, _PR0, but
this sentence doesn't seem to match the code.
Both.Linux shouldn't be assuming they support D3 just because they're newerIs this talking about D3hot or D3cold or both? If we can make this
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.
explicit, it will help me out. It's probably obvious to power
experts, but I'm not one.
Something that this patch makes me wonder is if the originalFixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
Reported-by: Iain Lane <iain@xxxxxxxxxxxxxxxxxxx>
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@xxxxxxx>
---
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