aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorGil Fine <gil.fine@intel.com>2022-05-26 13:59:17 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2022-06-06 12:19:23 +0300
commit418a5a3d6596f62424b24192b642d959d4c73d25 (patch)
tree37a518dfe485d614f7ec51fdf563bd1263301b85 /drivers/thunderbolt/switch.c
parentthunderbolt: Silently ignore CLx enabling in case CLx is not supported (diff)
downloadwireguard-linux-418a5a3d6596f62424b24192b642d959d4c73d25.tar.xz
wireguard-linux-418a5a3d6596f62424b24192b642d959d4c73d25.zip
thunderbolt: CLx disable before system suspend only if previously enabled
Disable CLx before system suspended only if previously was enabled. Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 561e1d77240e..0395229a3562 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -3134,8 +3134,10 @@ void tb_switch_suspend(struct tb_switch *sw, bool runtime)
* Actually only needed for Titan Ridge but for simplicity can be
* done for USB4 device too as CLx is re-enabled at resume.
*/
- if (tb_switch_disable_clx(sw, TB_CL0S))
- tb_sw_warn(sw, "failed to disable CLx on upstream port\n");
+ if (tb_switch_is_clx_enabled(sw)) {
+ if (tb_switch_disable_clx(sw, TB_CL0S))
+ tb_sw_warn(sw, "failed to disable CLx on upstream port\n");
+ }
err = tb_plug_events_active(sw, false);
if (err)