All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Gil Fine <gil.fine@linux.intel.com>
Cc: andreas.noever@gmail.com, YehezkelShB@gmail.com,
	gil.fine@intel.com, linux-usb@vger.kernel.org, lukas@wunner.de
Subject: Re: [PATCH 3/5] thunderbolt: Verify Router Ready bit is set after router enumeration
Date: Tue, 27 Jan 2026 10:53:34 +0100	[thread overview]
Message-ID: <20260127095334.GG2275908@black.igk.intel.com> (raw)
In-Reply-To: <20260126220606.3476657-4-gil.fine@linux.intel.com>

On Tue, Jan 27, 2026 at 12:06:04AM +0200, Gil Fine wrote:
> The USB4 Connection Manager guide specifies that after enumerating a
> router, the Connection Manager shall verify that the Router Ready bit
> (ROUTER_CS_6.RR) has been set to ensure hardware configuration has completed.
> Currently, this step is missing from the enumeration sequence.
> 
> Add this check to follow the Connection Manager guide more closely.
> 
> Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
> ---
>  drivers/thunderbolt/switch.c  | 5 +++++
>  drivers/thunderbolt/tb_regs.h | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
> index e7faa203b782..11e8c1dd3090 100644
> --- a/drivers/thunderbolt/switch.c
> +++ b/drivers/thunderbolt/switch.c
> @@ -2641,6 +2641,11 @@ int tb_switch_configure(struct tb_switch *sw)
>  			return ret;
>  
>  		ret = usb4_switch_setup(sw);
> +		if (ret)
> +			return ret;
> +
> +		ret = tb_switch_wait_for_bit(sw, ROUTER_CS_6, ROUTER_CS_6_RR,
> +					     ROUTER_CS_6_RR, 500);

Can you move this inside usb4_switch_setup()?


>  	} else {
>  		if (sw->config.vendor_id != PCI_VENDOR_ID_INTEL)
>  			tb_sw_warn(sw, "unknown switch vendor id %#x\n",
> diff --git a/drivers/thunderbolt/tb_regs.h b/drivers/thunderbolt/tb_regs.h
> index 71bed02a6974..7e65bc9bcb12 100644
> --- a/drivers/thunderbolt/tb_regs.h
> +++ b/drivers/thunderbolt/tb_regs.h
> @@ -216,6 +216,7 @@ struct tb_regs_switch_header {
>  #define ROUTER_CS_6_WOPS			BIT(2)
>  #define ROUTER_CS_6_WOUS			BIT(3)
>  #define ROUTER_CS_6_HCI				BIT(18)
> +#define ROUTER_CS_6_RR				BIT(24)
>  #define ROUTER_CS_6_CR				BIT(25)
>  #define ROUTER_CS_7				0x07
>  #define ROUTER_CS_9				0x09
> -- 
> 2.43.0

  reply	other threads:[~2026-01-27  9:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 22:06 [PATCH 0/5] CM fixes to follow CM guide more closely Gil Fine
2026-01-26 22:06 ` [PATCH 1/5] thunderbolt: Fix lane bonding log message when bonding not possible Gil Fine
2026-01-26 22:06 ` [PATCH 2/5] thunderbolt: Verify PCIe adapters in detect state before setup PCIe tunnel Gil Fine
2026-01-27  9:49   ` Mika Westerberg
2026-01-26 22:06 ` [PATCH 3/5] thunderbolt: Verify Router Ready bit is set after router enumeration Gil Fine
2026-01-27  9:53   ` Mika Westerberg [this message]
2026-01-26 22:06 ` [PATCH 4/5] thunderbolt: Increase timeout to wait for Configuration Ready bit Gil Fine
2026-01-26 22:06 ` [PATCH 5/5] thunderbolt: Increase Notification Timeout to 255 ms for USB4 routers Gil Fine

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=20260127095334.GG2275908@black.igk.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=gil.fine@intel.com \
    --cc=gil.fine@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=lukas@wunner.de \
    /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.