summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorBasavaraj Natikar <Basavaraj.Natikar@amd.com>2026-06-11 11:11:57 +0530
committerMika Westerberg <mika.westerberg@linux.intel.com>2026-07-27 11:59:43 +0200
commit5f40cba7d4fa343cf074d1a764683c1392f3134e (patch)
treefcfd30bc4712f6198e55222c7ffb8dc2b6efa92c /include/linux
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff)
thunderbolt: Assert downstream port reset on shutdown
On shutdown the connection manager tears down the router tree without signalling connected devices. A Thunderbolt 3 device directly connected to a USB4 host never receives a disconnect indication and during shutdown this can cause polling the dead link for up to 60 seconds. On some platforms this behavior leads to a warm reset instead of a shutdown due to this timeout. Fix this by asserting PORT_CS_19.DPR on each connected downstream port before tearing down the router tree. This drives SBTX low (USB4 spec section 6.9), causing the device to detect SBRX low and transition to Uninitialized Unplugged state immediately. Always do this on system shutdown/reboot by forcing host_reset in the PCI ->shutdown callback. On plain driver unload only do it when the host router was actually reset on load (host_reset=1), since in that case the tunnels are not preserved across reload anyway; with host_reset=0 the tunnels are kept alive across unload/reload so the links are left intact. Restrict the reset to Thunderbolt 3 devices. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Co-developed-by: Sanath S <Sanath.S@amd.com> Signed-off-by: Sanath S <Sanath.S@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/thunderbolt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h
index feb1af175cfd..cb1621c6b703 100644
--- a/include/linux/thunderbolt.h
+++ b/include/linux/thunderbolt.h
@@ -514,6 +514,11 @@ void tb_service_properties_changed(struct tb_service *svc);
* @hop_count: Number of rings (end point hops) supported by NHI.
* @quirks: NHI specific quirks if any
* @domain_released: Completed when domain has been fully released
+ * @host_reset: Host router was reset on driver load, or forced on system
+ * shutdown/reboot. When set, tb_stop() asserts DPR on connected
+ * downstream ports to signal disconnect before tearing down the
+ * router tree. Only Thunderbolt 3 devices are reset; USB4
+ * routers are skipped.
*/
struct tb_nhi {
spinlock_t lock;
@@ -528,6 +533,7 @@ struct tb_nhi {
u32 hop_count;
unsigned long quirks;
struct completion domain_released;
+ bool host_reset;
};
/**