Commit 5391bcfa authored by Mika Westerberg's avatar Mika Westerberg

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: 81af2952 ("thunderbolt: Add support for asymmetric link")
Reported-by: default avatarPengfei Xu <pengfei.xu@intel.com>
Tested-by: default avatarPengfei Xu <pengfei.xu@intel.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 24d85bb3
...@@ -2880,6 +2880,7 @@ static int tb_switch_lane_bonding_disable(struct tb_switch *sw) ...@@ -2880,6 +2880,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); 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) static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
{ {
struct tb_port *up, *down, *port; 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) ...@@ -2919,10 +2920,10 @@ static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
return ret; return ret;
} }
sw->link_width = width;
return 0; return 0;
} }
/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
static int tb_switch_asym_disable(struct tb_switch *sw) static int tb_switch_asym_disable(struct tb_switch *sw)
{ {
struct tb_port *up, *down; struct tb_port *up, *down;
...@@ -2957,7 +2958,6 @@ static int tb_switch_asym_disable(struct tb_switch *sw) ...@@ -2957,7 +2958,6 @@ static int tb_switch_asym_disable(struct tb_switch *sw)
return ret; return ret;
} }
sw->link_width = TB_LINK_WIDTH_DUAL;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment