On 9/5/2024 00:53, Mika Westerberg wrote:
On Wed, Sep 04, 2024 at 12:38:15PM -0500, Mario Limonciello wrote:
❯ ls -l /sys/bus/pci/drivers/thunderbolt/*/consumer*
lrwxrwxrwx 1 root root 0 Sep 4 12:33
/sys/bus/pci/drivers/thunderbolt/0000:c4:00.5/consumer:pci:0000:00:03.1 ->
../../../virtual/devlink/pci:0000:c4:00.5--pci:0000:00:03.1/
lrwxrwxrwx 1 root root 0 Sep 4 12:33
/sys/bus/pci/drivers/thunderbolt/0000:c4:00.6/consumer:pci:0000:00:04.1 ->
../../../virtual/devlink/pci:0000:c4:00.6--pci:0000:00:04.1/
❯ cat /sys/bus/pci/drivers/thunderbolt/*/power/runtime_status
suspended
active
I would have expected the USB4 host router to go back into runtime PM, but
it doesn't anymore until I reboot the system.
Yes, it should enter runtime suspend after a while. Would you mind
sharing dmesg around this?
I was capturing artifacts when all of a sudden it started to work. Then
I remembered I updated the BIOS on this system very recently. This is a
pre-production BIOS.
I downgraded back to old BIOS and everything works as you expect, so
there is some BIOS bug at play. I'll see if others can reproduce my
result and drive a BIOS solution.
Sorry for the noise on the patch, all is great!
Tested-by: Mario Limonciello <mario.limonciello@xxxxxxx>
I tried on my system and it works as expected (the device-power.sh is
internal script that dumps the device power states, I can share if you
want).
Devices 0d.2/3 are the host routers. 07.[0-3] are the PCIe tunnels (not
really used here but shown for completeness, I don't have PCIe tunnel
enabled to the hub). 0d.0 is the xHCI controller.
Plug in USB4 hub
----------------
# device-power.sh -s
All PCI devices (software state)
...
0000:00:07.0 8086:7ec4 Status: [D3cold] Real status: [ D0] Runtime PM: [suspended]
0000:00:07.1 8086:7ec5 Status: [D3cold] Real status: [ D0] Runtime PM: [suspended]
0000:00:07.2 8086:7ec6 Status: [D3cold] Real status: [ D0] Runtime PM: [suspended]
0000:00:07.3 8086:7ec7 Status: [D3cold] Real status: [ D0] Runtime PM: [suspended]
...
0000:00:0d.0 8086:7ec0 Status: [D3cold] Real status: [ D0] Runtime PM: [suspended]
0000:00:0d.2 8086:7ec2 Status: [ D0] Real status: [ D0] Runtime PM: [ active]
0000:00:0d.3 8086:7ec3 Status: [ D0] Real status: [ D0] Runtime PM: [ active]
Unplug and wait for the autosuspend_delay
-----------------------------------------
# device-power.sh -s
All PCI devices (software state)
...
0000:00:07.0 8086:7ec4 Status: [D3cold] Real status: [D3cold] Runtime PM: [suspended]
0000:00:07.1 8086:7ec5 Status: [D3cold] Real status: [D3cold] Runtime PM: [suspended]
0000:00:07.2 8086:7ec6 Status: [D3cold] Real status: [D3cold] Runtime PM: [suspended]
0000:00:07.3 8086:7ec7 Status: [D3cold] Real status: [D3cold] Runtime PM: [suspended]
...
0000:00:0d.0 8086:7ec0 Status: [D3cold] Real status: [D3cold] Runtime PM: [suspended]
0000:00:0d.2 8086:7ec2 Status: [D3cold] Real status: [D3cold] Runtime PM: [suspended]
0000:00:0d.3 8086:7ec3 Status: [D3cold] Real status: [D3cold] Runtime PM: [suspended]