]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
thunderbolt: Runtime PM activate both ends of the device link
authorMika Westerberg <mika.westerberg@linux.intel.com>
Sun, 14 Nov 2021 14:07:11 +0000 (16:07 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 10:02:32 +0000 (11:02 +0100)
commit9c6142cd1688afc0e215486ed105c69fd26d50c5
tree00339b0ec6e280405a8256edd97eba1088cd711e
parentbd3bdf93c415bc3172b634f90a6a8e3b74a6fc64
thunderbolt: Runtime PM activate both ends of the device link

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit f3380cac0c0b3a6f49ab161e2a057c363962f48d ]

If protocol tunnels are already up when the driver is loaded, for
instance if the boot firmware implements connection manager of its own,
runtime PM reference count of the consumer devices behind the tunnel
might have been increased already before the device link is created but
the supplier device runtime PM reference count is not. This leads to a
situation where the supplier (the Thunderbolt driver) can runtime
suspend even if it should not because the corresponding protocol tunnel
needs to be up causing the devices to be removed from the corresponding
native bus.

Prevent this from happening by making both sides of the link runtime PM
active briefly. The pm_runtime_put() for the consumer (PCIe
root/downstream port, xHCI) then allows it to runtime suspend again but
keeps the supplier runtime resumed the whole time it is runtime active.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/thunderbolt/acpi.c