Skip to content

Commit 3dc5525

Browse files
westerigregkh
authored andcommitted
thunderbolt: Send uevent after asymmetric/symmetric switch
commit 5391bcf upstream. We should send uevent to userspace whenever the link speed or width changes but tb_switch_asym_enable() and tb_switch_asym_disable() set the sw->link_width already so tb_switch_update_link_attributes() never noticed the change. Fix this so that we let tb_switch_update_link_attributes() update the fields accordingly. Fixes: 81af295 ("thunderbolt: Add support for asymmetric link") Reported-by: Pengfei Xu <pengfei.xu@intel.com> Tested-by: Pengfei Xu <pengfei.xu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6b56302 commit 3dc5525

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/thunderbolt/switch.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2981,6 +2981,7 @@ static int tb_switch_lane_bonding_disable(struct tb_switch *sw)
29812981
return tb_port_wait_for_link_width(down, TB_LINK_WIDTH_SINGLE, 100);
29822982
}
29832983

2984+
/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
29842985
static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
29852986
{
29862987
struct tb_port *up, *down, *port;
@@ -3020,10 +3021,10 @@ static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
30203021
return ret;
30213022
}
30223023

3023-
sw->link_width = width;
30243024
return 0;
30253025
}
30263026

3027+
/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
30273028
static int tb_switch_asym_disable(struct tb_switch *sw)
30283029
{
30293030
struct tb_port *up, *down;
@@ -3058,7 +3059,6 @@ static int tb_switch_asym_disable(struct tb_switch *sw)
30583059
return ret;
30593060
}
30603061

3061-
sw->link_width = TB_LINK_WIDTH_DUAL;
30623062
return 0;
30633063
}
30643064

0 commit comments

Comments
 (0)