thunderbolt: Tear down existing tunnels when resuming from hibernate
authorMika Westerberg <mika.westerberg@linux.intel.com>
Sun, 14 Nov 2021 15:20:59 +0000 (17:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:58:12 +0000 (09:58 +0100)
commit47dbf249699049c4c4b9ac4deb77170663bcbbc1
tree5a9c7a4d6643be0c83ac407074473a649dc6b6f5
parent509a32764e1a5692935c4f26ed96fbe94c480186
thunderbolt: Tear down existing tunnels when resuming from hibernate

commit 43bddb26e20af916249b5318200cfe1734c1700c upstream.

If the boot firmware implements connection manager of its own it may not
create the paths in the same way or order we do. For example it may
create first PCIe tunnel and then USB3 tunnel. When we restore our
tunnels (first de-activating them) we may be doing that over completely
different tunnels and that leaves them possibly non-functional. For this
reason we re-use the tunnel discovery functionality and find out all the
existing tunnels, and tear them down. Once that is done we can restore
our tunnels.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/path.c
drivers/thunderbolt/tb.c
drivers/thunderbolt/tb.h
drivers/thunderbolt/tunnel.c
drivers/thunderbolt/tunnel.h