]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
thunderbolt: Fix lane bonding log when bonding not possible
authorGil Fine <gil.fine@linux.intel.com>
Wed, 6 May 2026 12:37:04 +0000 (15:37 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 20 May 2026 09:54:34 +0000 (11:54 +0200)
Currently if lane bonding is not possible or not supported, we continue
and read the updated number of Total Buffers from lane adapters unnecessarily
and incorrectly log the bonding as successful.

Fix this by bailing out early when bonding is not possible, avoiding
the unnecessary read and the misleading log message.

Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/switch.c

index ad0ec8f8ee28177bbcd2a1bdf853fada1302cf5a..f421997c298db5e7f500cc9d7266d377757f0417 100644 (file)
@@ -2977,14 +2977,14 @@ static int tb_switch_lane_bonding_enable(struct tb_switch *sw)
        int ret;
 
        if (!tb_switch_lane_bonding_possible(sw))
-               return 0;
+               return -EOPNOTSUPP;
 
        up = tb_upstream_port(sw);
        down = tb_switch_downstream_port(sw);
 
        if (!tb_port_width_supported(up, TB_LINK_WIDTH_DUAL) ||
            !tb_port_width_supported(down, TB_LINK_WIDTH_DUAL))
-               return 0;
+               return -EOPNOTSUPP;
 
        /*
         * Both lanes need to be in CL0. Here we assume lane 0 already be in