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>
struct tb_cm *tcm = tb_priv(port->sw->tb);
struct tb_port *upstream_port;
struct tb_switch *sw;
struct tb_cm *tcm = tb_priv(port->sw->tb);
struct tb_port *upstream_port;
struct tb_switch *sw;
if (tb_is_upstream_port(port))
return;
if (tb_is_upstream_port(port))
return;
tb_switch_lane_bonding_enable(sw);
/* Set the link configured */
tb_switch_configure_link(sw);
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,
tb_sw_warn(sw, "failed to enable CLx on upstream port\n");
tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_HIFI,
static void tb_restore_children(struct tb_switch *sw)
{
struct tb_port *port;
static void tb_restore_children(struct tb_switch *sw)
{
struct tb_port *port;
/* No need to restore if the router is already unplugged */
if (sw->is_unplugged)
return;
/* 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");
/*
tb_sw_warn(sw, "failed to re-enable CLx on upstream port\n");
/*