Skip to contentSkip to conversation

thunderbolt: Disable Gen 4 Recovery on Asymmetric Transitions

PATCH Superseded Mohammad Rahimi 2 participants 10 messages Jan 31, 2025 – Feb 4, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 thunderbolt: Disable Gen 4 Recovery on Asymmetric Transitions

Dear Mika,

V4 of this patch resolves the styling issues identified in v3 by ./scripts/checkpatch.pl. Apologies for the inconvenience.

Best regards,
Mohammad Rahimi

#1 lore raw

PATCH v4 1/1 thunderbolt: Disable Gen 4 Recovery on Asymmetric Transitions

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

---
 drivers/thunderbolt/tb.c      | 18 ++++++--
 drivers/thunderbolt/tb.h      |  3 ++
 drivers/thunderbolt/tb_regs.h |  1 +
 drivers/thunderbolt/usb4.c    | 77 +++++++++++++++++++++++++++++++++++
 4 files changed, 96 insertions(+), 3 deletions(-)
drivers/thunderbolt/tb.c +15 -3
index a7c6919fbf97..a3ccfb398797 100644
@@ -1013,6 +1013,7 @@ static int tb_configure_asym(struct tb *tb, struct tb_port *src_port,
 			     struct tb_port *dst_port, int requested_up,
 			     int requested_down)
 {
+	bool link_recovery_up = false, link_recovery_down = false;
 	bool clx = false, clx_disabled = false, downstream;
 	struct tb_switch *sw;
 	struct tb_port *up;
@@ -1075,15 +1076,19 @@ static int tb_configure_asym(struct tb *tb, struct tb_port *src_port,
 			continue;
 
 		/*
-		 * Disable CL states before doing any transitions. We
-		 * delayed it until now that we know there is a real
-		 * transition taking place.
+		 * Disable CL states and Link Recovery before doing any
+		 * transitions. We delayed it until now that we know
+		 * there is a real transition taking place.
 		 */
 		if (!clx_disabled) {
 			clx = tb_disable_clx(sw);
 			clx_disabled = true;
 		}
 
+		/* Ignore non-critical errors of disabling Link Recovery */
+		link_recovery_up = (usb4_port_link_recovery_disable(up) > 0);
+		link_recovery_down = (usb4_port_link_recovery_disable(down) > 0);
+
 		tb_sw_dbg(up->sw, "configuring asymmetric link\n");
 
 		/*
@@ -1091,6 +1096,13 @@ static int tb_configure_asym(struct tb *tb, struct tb_port *src_port,
 		 * transtion the link into asymmetric now.
 		 */
 		ret = tb_switch_set_link_width(up->sw, width_up);
+
+		/* Re-enable Link Recovery if they were previously enabled */
+		if (link_recovery_up)
+			usb4_port_link_recovery_enable(up);
+		if (link_recovery_down)
+			usb4_port_link_recovery_enable(down);
+
 		if (ret) {
 			tb_sw_warn(up->sw, "failed to set link width\n");
 			break;
drivers/thunderbolt/tb.h +3 -0
index ddbf0cd78377..d37d778082fc 100644
@@ -1332,6 +1332,9 @@ int usb4_port_router_online(struct tb_port *port);
 int usb4_port_enumerate_retimers(struct tb_port *port);
 bool usb4_port_clx_supported(struct tb_port *port);
 
+int usb4_port_link_recovery_enable(struct tb_port *port);
+int usb4_port_link_recovery_disable(struct tb_port *port);
+
 bool usb4_port_asym_supported(struct tb_port *port);
 int usb4_port_asym_set_link_width(struct tb_port *port, enum tb_link_width width);
 int usb4_port_asym_start(struct tb_port *port);
drivers/thunderbolt/tb_regs.h +1 -0
index 4e43b47f9f11..085139e1a958 100644
@@ -398,6 +398,7 @@ struct tb_regs_port_header {
 #define PORT_CS_19_WOD				BIT(17)
 #define PORT_CS_19_WOU4				BIT(18)
 #define PORT_CS_19_START_ASYM			BIT(24)
+#define PORT_CS_19_ELR				BIT(31)
 
 /* Display Port adapter registers */
 #define ADP_DP_CS_0				0x00
drivers/thunderbolt/usb4.c +77 -0

89 lines not on this page · raw message

Signature · 1 line
2.45.2
#2 lore raw

Hi,

Quoted 15 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 1 line

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

I tested on Intel reference hardware as well but on those link recovery is already disabled so it pretty much does nothing. Below are the steps that I followed:

1. Boot with "thunderbolt.asym_threshold=10000" so that the driver switches links to asymmetric already upon first DP connect.

2. Connect USB4 v2 hub.
3. Check link and PORT_CS_19:

# tblist -v
Domain 0 Route 0: 8087:5781 Intel Barlow Host Router
  Type: Router
  UUID: c9680000...
  Generation: USB4
  NVM version: 56.81

Domain 0 Route 1: 8087:1234 Intel Barlow HUB Router
Type: Router
Speed (Rx/Tx): 80/80 Gb/s
Authorized: No
UUID: e9688780...
Generation: USB4
NVM version: 56.81

# tbdump -r 0 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19     
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)
# tbdump -r 1 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19     
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)

3. Connect monitor to USB4 v2 hub.
4. Check link and PORT_CS_19.

# tblist -v
Domain 0 Route 0: 8087:5781 Intel Barlow Host Router
  Type: Router
  UUID: c9680000...
  Generation: USB4
  NVM version: 56.81

Domain 0 Route 1: 8087:1234 Intel Barlow HUB Router
Type: Router
Speed (Rx/Tx): 120/40 Gb/s
Authorized: No
UUID: e9688780...
Generation: USB4
NVM version: 56.81

# tbdump -r 0 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)
# tbdump -r 1 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)
#3 lore raw

Hello.

Quoted 18 lines · Mika Westerberg

Hi,

Quoted 15 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 5 lines
Quoted 1 line

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

Looks great. Just one question:

In tb_configure_asym(), if tb_switch_set_link_width() fails, we won’t restore the link recovery status. Is that okay?

Quoted 102 lines

I tested on Intel reference hardware as well but on those link recovery is already disabled so it pretty much does nothing. Below are the steps that I followed:

1. Boot with "thunderbolt.asym_threshold=10000" so that the driver switches links to asymmetric already upon first DP connect.

2. Connect USB4 v2 hub.
3. Check link and PORT_CS_19:

# tblist -v
Domain 0 Route 0: 8087:5781 Intel Barlow Host Router
  Type: Router
  UUID: c9680000...
  Generation: USB4
  NVM version: 56.81

Domain 0 Route 1: 8087:1234 Intel Barlow HUB Router
Type: Router
Speed (Rx/Tx): 80/80 Gb/s
Authorized: No
UUID: e9688780...
Generation: USB4
NVM version: 56.81

# tbdump -r 0 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19     
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)
# tbdump -r 1 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19     
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)

3. Connect monitor to USB4 v2 hub.
4. Check link and PORT_CS_19.

# tblist -v
Domain 0 Route 0: 8087:5781 Intel Barlow Host Router
  Type: Router
  UUID: c9680000...
  Generation: USB4
  NVM version: 56.81

Domain 0 Route 1: 8087:1234 Intel Barlow HUB Router
Type: Router
Speed (Rx/Tx): 120/40 Gb/s
Authorized: No
UUID: e9688780...
Generation: USB4
NVM version: 56.81

# tbdump -r 0 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)
# tbdump -r 1 -a 1 -vv -N 1 PORT_CS_19
0x00d3 0x0004000e 0b00000000 00000100 00000000 00001110 .... PORT_CS_19
  [00:00]        0x0 Downstream Port Reset (DPR)
  [01:01]        0x1 Request RS-FEC Gen 2 (RS2)
  [02:02]        0x1 Request RS-FEC Gen 3 (RS3)
  [03:03]        0x1 USB4 Port is Configured (PC)
  [04:04]        0x0 USB4 Port is Inter-Domain (PID)
  [16:16]        0x0 Enable Wake on Connect
  [17:17]        0x0 Enable Wake on Disconnect
  [18:18]        0x1 Enable Wake on USB4 Wake
  [19:19]        0x0 Enable Wake on Inter-Domain
  [24:24]        0x0 StartAsymmetricFlow
  [30:30]        0x0 Initiate Gen 4 Link Recovery (ILR)
  [31:31]        0x0 Enable Gen 4 Link Recovery (ELR)
#4 lore raw

Hi,

Quoted 23 lines · Mohammad Rahimi

Hello.

Quoted 20 lines · Mika Westerberg

Hi,

Quoted 16 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 8 lines
Quoted 3 lines

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

Looks great. Just one question:

In tb_configure_asym(), if tb_switch_set_link_width() fails, we won’t restore the link recovery status. Is that okay?

Good question :) Looking at the ECR, does it actually say anywhere that the CM should needs to re-enable it? I'm thinking that we could just disable it and be done with it?

#5 lore raw

Hello again.

Quoted 30 lines · Mika Westerberg

Hi,

Quoted 27 lines · Mohammad Rahimi

Hello.

Quoted 23 lines · Mika Westerberg

Hi,

Quoted 15 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 1 line

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

Quoted 8 lines
Quoted 4 lines

Looks great. Just one question:

In tb_configure_asym(), if tb_switch_set_link_width() fails, we won’t restore the link recovery status. Is that okay?

Good question :) Looking at the ECR, does it actually say anywhere that the CM should needs to re-enable it? I'm thinking that we could just disable it and be done with it?

Right. Thanks for clearing that up.

#6 lore raw
Quoted 35 lines · Mohammad Rahimi

Hello again.

Quoted 32 lines · Mika Westerberg

Hi,

Quoted 29 lines · Mohammad Rahimi

Hello.

Quoted 18 lines · Mika Westerberg

Hi,

Quoted 15 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 5 lines
Quoted 1 line

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

Looks great. Just one question:

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

In tb_configure_asym(), if tb_switch_set_link_width() fails, we won’t restore the link recovery status. Is that okay?

Good question :) Looking at the ECR, does it actually say anywhere that the CM should needs to re-enable it? I'm thinking that we could just disable it and be done with it?

Right. Thanks for clearing that up.

I'll check with the HW/FW folks still if they have any suggestions. I'll keep you updated.

#7 lore raw
Quoted 39 lines · Mika Westerberg
Quoted 38 lines · Mohammad Rahimi

Hello again.

Quoted 35 lines · Mika Westerberg

Hi,

Quoted 31 lines · Mohammad Rahimi

Hello.

Quoted 18 lines · Mika Westerberg

Hi,

Quoted 15 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 5 lines
Quoted 1 line

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

Looks great. Just one question:

In tb_configure_asym(), if tb_switch_set_link_width() fails, we won’t restore the link recovery status. Is that okay?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Good question :) Looking at the ECR, does it actually say anywhere that the CM should needs to re-enable it? I'm thinking that we could just disable it and be done with it?

Right. Thanks for clearing that up.

I'll check with the HW/FW folks still if they have any suggestions. I'll keep you updated.

Did not hear anything from them yet but I adjusted the patch slightly to restore ELR if tb_switch_set_link_width() and also added back the check > 0 which I missed. Let me know if you find issues with this one. Thanks!

#8 lore raw

Hi Again,

Quoted 44 lines · Mika Westerberg
Quoted 43 lines · Mika Westerberg
Quoted 42 lines · Mohammad Rahimi

Hello again.

Quoted 38 lines · Mika Westerberg

Hi,

Quoted 23 lines · Mohammad Rahimi

Hello.

Quoted 20 lines · Mika Westerberg

Hi,

Quoted 16 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 8 lines
Quoted 3 lines

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

Looks great. Just one question:

In tb_configure_asym(), if tb_switch_set_link_width() fails, we won’t restore the link recovery status. Is that okay?

Good question :) Looking at the ECR, does it actually say anywhere that the CM should needs to re-enable it? I'm thinking that we could just disable it and be done with it?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Right. Thanks for clearing that up.

I'll check with the HW/FW folks still if they have any suggestions. I'll keep you updated.

Did not hear anything from them yet but I adjusted the patch slightly to restore ELR if tb_switch_set_link_width() and also added back the check > 0 which I missed. Let me know if you find issues with this one. Thanks!

Okay got response now. It turns out this feature is something CM needs to enable if needed (e.g it is not automatically enabled by any router) and we don't do that which means this patch is not necessary, sorry. I'm going to drop it for now. Let me know if you think otherwise. Thanks!

#9 lore raw

Hello dear Mika.

Quoted 52 lines · Mika Westerberg

Hi Again,

Quoted 49 lines · Mika Westerberg
Quoted 47 lines · Mika Westerberg
Quoted 35 lines · Mohammad Rahimi

Hello again.

Quoted 32 lines · Mika Westerberg

Hi,

Quoted 29 lines · Mohammad Rahimi

Hello.

Quoted 18 lines · Mika Westerberg

Hi,

Quoted 15 lines · Mohammad Rahimi

Updates the Connection Manager to disable the Gen 4 Link Recovery flow before transitioning from a Symmetric Link to an Asymmetric Link, as specified in recent changes to the USB4 v2 specification.

According to the "USB4 2.0 ENGINEERING CHANGE NOTICE FORM" published in September 2024, the rationale for this change is:

"Since the default value of the Target Asymmetric Link might be different than Symmetric Link and Gen 4 Link Recovery flow checks this field to make sure it matched the actual Negotiated Link Width, we’re removing the condition for a Disconnect in the Gen 4 Link Recovery flow when Target Asymmetric Link doesn’t match the actual Link width and adding a Connection Manager note to Disable Gen 4 Link Recovery flow before doing Asymmetric Transitions."

Quoted 5 lines
Quoted 1 line

I did some minor modifications and applied to thunderbolt.git/next. Please let me know if I missed something.

Looks great. Just one question:

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

In tb_configure_asym(), if tb_switch_set_link_width() fails, we won’t restore the link recovery status. Is that okay?

Good question :) Looking at the ECR, does it actually say anywhere that the CM should needs to re-enable it? I'm thinking that we could just disable it and be done with it?

Right. Thanks for clearing that up.

I'll check with the HW/FW folks still if they have any suggestions. I'll keep you updated.

Quoted 8 lines
Quoted 3 lines

Did not hear anything from them yet but I adjusted the patch slightly to restore ELR if tb_switch_set_link_width() and also added back the check > 0 which I missed. Let me know if you find issues with this one. Thanks!

Okay got response now. It turns out this feature is something CM needs to enable if needed (e.g it is not automatically enabled by any router) and we don't do that which means this patch is not necessary, sorry. I'm going to drop it for now. Let me know if you think otherwise. Thanks!

Oh, I also overlooked that CM has full discretion to enable or disable it. Anyway, thank you for keeping me in the loop and for all your help with this patch.