summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tb.c
diff options
context:
space:
mode:
authorGil Fine <gil.fine@intel.com>2022-05-26 13:59:16 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2022-06-06 12:19:22 +0300
commit990f4b85d7d9bb954a24ada7145947dec501fe3d (patch)
treed454a175539d81375f7feb07be25ff3e76595693 /drivers/thunderbolt/tb.c
parentf2906aa863381afb0015a9eb7fefad885d4e5a56 (diff)
downloadlinux-990f4b85d7d9bb954a24ada7145947dec501fe3d.tar.xz
thunderbolt: Silently ignore CLx enabling in case CLx is not supported
We can't enable CLx if it is not supported either by the host or device, or by the USB4/TBT link (e.g. when an optical cable is used). We silently ignore CLx enabling in this case. Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r--drivers/thunderbolt/tb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 9a3214fb5038..8ab3530dfa0d 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -575,6 +575,7 @@ static void tb_scan_port(struct tb_port *port)
struct tb_cm *tcm = tb_priv(port->sw->tb);
struct tb_port *upstream_port;
struct tb_switch *sw;
+ int ret;
if (tb_is_upstream_port(port))
return;
@@ -663,7 +664,9 @@ static void tb_scan_port(struct tb_port *port)
tb_switch_lane_bonding_enable(sw);
/* Set the link configured */
tb_switch_configure_link(sw);
- if (tb_switch_enable_clx(sw, TB_CL0S))
+ /* Silently ignore CLx enabling in case CLx is not supported */
+ ret = tb_switch_enable_clx(sw, TB_CL0S);
+ if (ret && ret != -EOPNOTSUPP)
tb_sw_warn(sw, "failed to enable CLx on upstream port\n");
tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_HIFI,
@@ -1446,12 +1449,15 @@ static int tb_suspend_noirq(struct tb *tb)
static void tb_restore_children(struct tb_switch *sw)
{
struct tb_port *port;
+ int ret;
/* No need to restore if the router is already unplugged */
if (sw->is_unplugged)
return;
- if (tb_switch_enable_clx(sw, TB_CL0S))
+ /* Silently ignore CLx re-enabling in case CLx is not supported */
+ ret = tb_switch_enable_clx(sw, TB_CL0S);
+ if (ret && ret != -EOPNOTSUPP)
tb_sw_warn(sw, "failed to re-enable CLx on upstream port\n");
/*