Re: [PATCH] thunderbolt: Skip mapped PCIe down port when config read fails
From: Mika Westerberg
Date: Tue Apr 14 2026 - 08:44:42 EST
Hi,
On Tue, Apr 14, 2026 at 07:37:35PM +0800, Chia-Lin Kao (AceLan) wrote:
> tb_find_pcie_down() uses tb_pci_port_is_enabled() to check whether a
> mapped downstream PCIe port is already in use before returning it for
> tunnel activation. tb_pci_port_is_enabled() returns false both when the
> port is genuinely disabled and when tb_port_read() fails (e.g. -EIO).
>
> After resume on TBT5/PTL hardware the host router is not immediately
> accessible. A config read on the mapped port returns -EIO. This causes
> tb_pci_port_is_enabled() to return false, making tb_find_pcie_down()
> treat the still-mapped port as free. tb_tunnel_activate() is then
> called on this already-mapped port, fails with -EIO, and logs:
>
> "PCIe tunnel activation failed, aborting"
>
> The display connected via the Thunderbolt dock is then lost until the
> dock is unplugged and replugged.
>
> Fix this by inlining the config read in tb_find_pcie_down() and
> distinguishing three outcomes:
> - Read succeeds, PE bit set -> port in use, skip (goto out)
> - Read succeeds, PE bit clear -> port free, return it
> - Read fails -> hardware not ready, skip (goto out)
There should really be no "hardware not ready" when the host router is
enumerated. Lets try to figure out what is happening there.
Can you enable tracing, reproduce and send me full dmesg + trace?
You can do it like:
# tbtrace enable
Then repro, and then:
# tbtrace disable
# tbtrace dump -vv > trace.out
and send me that and full dmesg.