thunderbolt: Send uevent after asymmetric/symmetric switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>

commit 5391bcfa56c79a891734e4d22aa0ca3217b86491 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: 81af2952e606 ("thunderbolt: Add support for asymmetric link")
Reported-by: Pengfei Xu <pengfei.xu@xxxxxxxxx>
Tested-by: Pengfei Xu <pengfei.xu@xxxxxxxxx>
Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/thunderbolt/switch.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -2981,6 +2981,7 @@ static int tb_switch_lane_bonding_disabl
 	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;
@@ -3020,10 +3021,10 @@ static int tb_switch_asym_enable(struct
 			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;
@@ -3058,7 +3059,6 @@ static int tb_switch_asym_disable(struct
 			return ret;
 	}
 
-	sw->link_width = TB_LINK_WIDTH_DUAL;
 	return 0;
 }
 


Patches currently in stable-queue which might be from mika.westerberg@xxxxxxxxxxxxxxx are

queue-6.6/thunderbolt-fix-null-pointer-dereference-in-tb_port_update_credits.patch
queue-6.6/thunderbolt-introduce-tb_switch_depth.patch
queue-6.6/thunderbolt-send-uevent-after-asymmetric-symmetric-switch.patch
queue-6.6/thunderbolt-fix-debug-log-when-displayport-adapter-not-available-for-pairing.patch
queue-6.6/thunderbolt-change-bandwidth-reservations-to-comply-usb4-v2.patch
queue-6.6/thunderbolt-configure-asymmetric-link-if-needed-and-bandwidth-allows.patch
queue-6.6/thunderbolt-fix-minimum-allocated-usb-3.x-and-pcie-bandwidth.patch
queue-6.6/thunderbolt-make-is_gen4_link-available-to-the-rest-of-the-driver.patch
queue-6.6/thunderbolt-add-support-for-asymmetric-link.patch
queue-6.6/thunderbolt-introduce-tb_for_each_upstream_port_on_path.patch
queue-6.6/thunderbolt-improve-displayport-tunnel-setup-process-to-be-more-robust.patch
queue-6.6/thunderbolt-expose-tb_tunnel_xxx-log-macros-to-the-rest-of-the-driver.patch
queue-6.6/thunderbolt-use-constants-for-path-weight-and-priority.patch
queue-6.6/thunderbolt-introduce-tb_port_path_direction_downstream.patch
queue-6.6/thunderbolt-use-weight-constants-in-tb_usb3_consumed_bandwidth.patch
queue-6.6/thunderbolt-create-multiple-displayport-tunnels-if-there-are-more-dp-in-out-pairs.patch
queue-6.6/thunderbolt-use-tb_tunnel_dbg-where-possible-to-make-logging-more-consistent.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux