Skip to content

Commit 5391bcf

Browse files
committed
thunderbolt: Send uevent after asymmetric/symmetric switch
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>
1 parent 24d85bb commit 5391bcf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/thunderbolt/switch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2880,6 +2880,7 @@ static int tb_switch_lane_bonding_disable(struct tb_switch *sw)
28802880
return tb_port_wait_for_link_width(down, TB_LINK_WIDTH_SINGLE, 100);
28812881
}
28822882

2883+
/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
28832884
static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
28842885
{
28852886
struct tb_port *up, *down, *port;
@@ -2919,10 +2920,10 @@ static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
29192920
return ret;
29202921
}
29212922

2922-
sw->link_width = width;
29232923
return 0;
29242924
}
29252925

2926+
/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
29262927
static int tb_switch_asym_disable(struct tb_switch *sw)
29272928
{
29282929
struct tb_port *up, *down;
@@ -2957,7 +2958,6 @@ static int tb_switch_asym_disable(struct tb_switch *sw)
29572958
return ret;
29582959
}
29592960

2960-
sw->link_width = TB_LINK_WIDTH_DUAL;
29612961
return 0;
29622962
}
29632963

0 commit comments

Comments
 (0)