thunderbolt: Mark XDomain as unplugged when router is removed
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 13 Jun 2024 12:05:03 +0000 (15:05 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 6 Aug 2024 05:01:10 +0000 (08:01 +0300)
commite2006140ad2e01a02ed0aff49cc2ae3ceeb11f8d
treee2de9c658525d88f9535c421cb12e4a0c76a01cc
parentab3de2c7ec91db6a3cf5fc07765852c81ca7d6ef
thunderbolt: Mark XDomain as unplugged when router is removed

I noticed that when we do discrete host router NVM upgrade and it gets
hot-removed from the PCIe side as a result of NVM firmware authentication,
if there is another host connected with enabled paths we hang in tearing
them down. This is due to fact that the Thunderbolt networking driver
also tries to cleanup the paths and ends up blocking in
tb_disconnect_xdomain_paths() waiting for the domain lock.

However, at this point we already cleaned the paths in tb_stop() so
there is really no need for tb_disconnect_xdomain_paths() to do that
anymore. Furthermore it already checks if the XDomain is unplugged and
bails out early so take advantage of that and mark the XDomain as
unplugged when we remove the parent router.

Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/switch.c