RISCV: config: tizen_visionfive2: Disable JH7110 crypto driver
[platform/kernel/linux-starfive.git] / drivers / thunderbolt / switch.c
index 43171cc..509b99a 100644 (file)
@@ -1082,7 +1082,7 @@ int tb_port_lane_bonding_enable(struct tb_port *port)
         * Only set bonding if the link was not already bonded. This
         * avoids the lane adapter to re-enter bonding state.
         */
-       if (width == TB_LINK_WIDTH_SINGLE) {
+       if (width == TB_LINK_WIDTH_SINGLE && !tb_is_upstream_port(port)) {
                ret = tb_port_set_lane_bonding(port, true);
                if (ret)
                        goto err_lane1;
@@ -2725,6 +2725,13 @@ int tb_switch_lane_bonding_enable(struct tb_switch *sw)
            !tb_port_is_width_supported(down, TB_LINK_WIDTH_DUAL))
                return 0;
 
+       /*
+        * Both lanes need to be in CL0. Here we assume lane 0 already be in
+        * CL0 and check just for lane 1.
+        */
+       if (tb_wait_for_port(down->dual_link_port, false) <= 0)
+               return -ENOTCONN;
+
        ret = tb_port_lane_bonding_enable(up);
        if (ret) {
                tb_port_warn(up, "failed to enable lane bonding\n");