Skip to content

Commit

Permalink
thunderbolt: Send uevent after asymmetric/symmetric switch
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Pengfei Xu <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
westeri authored and gregkh committed Oct 4, 2024
1 parent 6b56302 commit 3dc5525
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/thunderbolt/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2981,6 +2981,7 @@ static int tb_switch_lane_bonding_disable(struct tb_switch *sw)
return tb_port_wait_for_link_width(down, TB_LINK_WIDTH_SINGLE, 100);
}

/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
{
struct tb_port *up, *down, *port;
Expand Down Expand Up @@ -3020,10 +3021,10 @@ static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
return ret;
}

sw->link_width = width;
return 0;
}

/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
static int tb_switch_asym_disable(struct tb_switch *sw)
{
struct tb_port *up, *down;
Expand Down Expand Up @@ -3058,7 +3059,6 @@ static int tb_switch_asym_disable(struct tb_switch *sw)
return ret;
}

sw->link_width = TB_LINK_WIDTH_DUAL;
return 0;
}

Expand Down

0 comments on commit 3dc5525

Please sign in to comment.