From: Gil Fine Date: Wed, 6 May 2026 12:37:04 +0000 (+0300) Subject: thunderbolt: Fix lane bonding log when bonding not possible X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ab47718345dc58a6e2ff4c1c23a9026a2cf1310;p=thirdparty%2Fkernel%2Fstable.git thunderbolt: Fix lane bonding log when bonding not possible 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 Signed-off-by: Mika Westerberg --- diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index ad0ec8f8ee28..f421997c298d 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -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