All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Mohammad Rahimi <rahimi.mhmmd@gmail.com>
Cc: andreas.noever@gmail.com, michael.jamet@intel.com,
	YehezkelShB@gmail.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] thunderbolt: Disable Gen 4 Recovery on Asymmetric Transitions
Date: Mon, 3 Feb 2025 10:42:24 +0200	[thread overview]
Message-ID: <20250203084224.GE3713119@black.fi.intel.com> (raw)
In-Reply-To: <20250131014406.28645-4-rahimi.mhmmd@gmail.com>

Hi,

On Fri, Jan 31, 2025 at 01:41:27AM +0000, Mohammad Rahimi wrote:
> 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."
> 
> Signed-off-by: Mohammad Rahimi <rahimi.mhmmd@gmail.com>

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)

  reply	other threads:[~2025-02-03  8:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31  1:41 [PATCH v4 Cover Letter] thunderbolt: Disable Gen 4 Recovery on Asymmetric Transitions Mohammad Rahimi
2025-01-31  1:41 ` [PATCH v4] " Mohammad Rahimi
2025-02-03  8:42   ` Mika Westerberg [this message]
2025-02-03 12:25     ` Mohammad Rahimi
2025-02-03 12:39       ` Mika Westerberg
2025-02-03 12:43         ` Mohammad Rahimi
2025-02-03 12:59           ` Mika Westerberg
2025-02-04 11:16             ` Mika Westerberg
2025-02-04 11:39               ` Mika Westerberg
2025-02-04  2:35                 ` Mohammad Rahimi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250203084224.GE3713119@black.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    --cc=rahimi.mhmmd@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.