summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-02-20 00:37:35 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2019-04-18 11:18:52 +0300
commitaae9e27f3b72ed58d6b87c8f511e7812601a93c5 (patch)
treec78d28bd8d42f7548f40907120dcc9ea235b6231 /drivers/thunderbolt
parent8c7acaaf020fe54baf2eccc5e1071341754d22be (diff)
downloadlinux-aae9e27f3b72ed58d6b87c8f511e7812601a93c5.tar.xz
thunderbolt: Deactivate all paths before restarting them
State of the connected devices and tunnel configuration is not known during resume. For example some paths may not be complete anymore if the user has unplugged the related devices. So instead of marking all paths as inactive we go ahead and deactivate them explicitly before we restart them. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/tunnel.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c
index 91d7e00516b4..e109578da175 100644
--- a/drivers/thunderbolt/tunnel.c
+++ b/drivers/thunderbolt/tunnel.c
@@ -185,8 +185,18 @@ int tb_tunnel_restart(struct tb_tunnel *tunnel)
tb_tunnel_info(tunnel, "activating\n");
+ /*
+ * Make sure all paths are properly disabled before enabling
+ * them again.
+ */
+ for (i = 0; i < tunnel->npaths; i++) {
+ if (tunnel->paths[i]->activated) {
+ tb_path_deactivate(tunnel->paths[i]);
+ tunnel->paths[i]->activated = false;
+ }
+ }
+
for (i = 0; i < tunnel->npaths; i++) {
- tunnel->paths[i]->activated = false;
res = tb_path_activate(tunnel->paths[i]);
if (res)
goto err;