Bug 216464

Summary: On TGL-H, unplugging TBT dock wakes the system up from s2idle
Product: ACPI Reporter: Kai-Heng Feng (kai.heng.feng)
Component: Power-Sleep-WakeAssignee: acpi_power-sleep-wake
Status: NEW ---    
Severity: normal CC: max.lee, mika.westerberg, neo.wong
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: mainline, linux-next Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg
lspci -vvnn

Description Kai-Heng Feng 2022-09-08 15:05:16 UTC
Created attachment 301775 [details]
dmesg

The GPE of TBT's power resource gets toggled:
[  186.866656] PM: suspend-to-idle
[  186.866772] ACPI: EC: ACPI EC GPE status set
[  186.866802] ACPI: PM: Rearming ACPI SCI for wakeup
[  192.934925] Timekeeping suspended for 5.659 seconds
[  192.935494] ACPI: PM: ACPI non-EC GPE wakeup
[  192.935513] PM: resume from suspend-to-idle
Comment 1 Kai-Heng Feng 2022-09-08 15:05:32 UTC
Created attachment 301776 [details]
lspci -vvnn
Comment 2 Kai-Heng Feng 2022-09-08 15:08:13 UTC
Preferably Linux should have a "wakeup reason" so the kernel can decide to go back to sleep again, but it may not be feasible with current suspend flow, so maybe a firmware tweak at TBT host is more plausible.
Comment 3 Neo Wong 2022-09-22 08:37:59 UTC
Hi, Will you let us know the behavior you saw in :

1. ADL vs TGL
2. Linux vs Windows 

With same device and OS configuration.
Comment 4 Neo Wong 2022-09-23 06:49:37 UTC
The wakeup in TGL-H when unplugging a device in s2idle (or Modern Standby in Windows terms) is a platform feature. So this is not a bug.
Comment 5 Max Lee 2022-09-23 07:09:35 UTC
In the ADL-P. the system doesn't wake up after unplug TBT devices.
but the TGL-U/H, we can see the wake up. 
Do you have such document can share the feature details for reference?

and Windows is wakeup by power source changed.
but in Linux, it's not an AC power wake and wake by TBT.

The GPE of TBT's power resource gets toggled:
[  186.866656] PM: suspend-to-idle
[  186.866772] ACPI: EC: ACPI EC GPE status set
[  186.866802] ACPI: PM: Rearming ACPI SCI for wakeup
[  192.934925] Timekeeping suspended for 5.659 seconds
[  192.935494] ACPI: PM: ACPI non-EC GPE wakeup
[  192.935513] PM: resume from suspend-to-idle
Comment 6 Neo Wong 2022-09-23 07:16:36 UTC
It could be due to SW_CM (ADL) vs FM_CM (TGL) result the different configurations.

> but in Linux, it's not an AC power wake and wake by TBT.
Yes, it's control by TBT FW.
Comment 7 Max Lee 2022-09-23 07:31:39 UTC
That's make sense, will you debug the TBT CM FW to fix the issue?
Comment 8 Neo Wong 2022-09-26 06:17:44 UTC
As it's a platform feature, there is no plan to fix or change the behavior.
Comment 9 Max Lee 2022-09-26 06:26:36 UTC
Do you have any TA or documents can share about the behavior?