From: Gil Fine <gil.fine@linux.intel.com>
To: andreas.noever@gmail.com, mika.westerberg@linux.intel.com,
YehezkelShB@gmail.com
Cc: gil.fine@intel.com, linux-usb@vger.kernel.org, lukas@wunner.de,
Gil Fine <gil.fine@linux.intel.com>
Subject: [PATCH 5/5] thunderbolt: Increase Notification Timeout to 255 ms for USB4 routers
Date: Tue, 27 Jan 2026 00:06:06 +0200 [thread overview]
Message-ID: <20260126220606.3476657-6-gil.fine@linux.intel.com> (raw)
In-Reply-To: <20260126220606.3476657-1-gil.fine@linux.intel.com>
Currently we set the Notification Timeout field in ROUTER_CS_4 for USB4
routers to 10 ms, which is unnecessarily short and may cause unnecessary
retransmissions of Hot Plug packets by the router in case of slow
software response.
Change Notification Timeout for USB4 routers to use 255 ms, aligning
their behavior with Thunderbolt 3 and providing adequate time for
software to process Hot Plug Events.
While there, also fix the comment describing the Notification Timeout
field to match the USB4 specification.
Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
---
drivers/thunderbolt/switch.c | 13 +++----------
drivers/thunderbolt/tb_regs.h | 3 +--
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 11e8c1dd3090..7962a7e9d4b3 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -1742,8 +1742,6 @@ int tb_switch_wait_for_bit(struct tb_switch *sw, u32 offset, u32 bit,
/*
* tb_plug_events_active() - enable/disable plug events on a switch
*
- * Also configures a sane plug_events_delay of 255ms.
- *
* Return: %0 on success, negative errno otherwise.
*/
static int tb_plug_events_active(struct tb_switch *sw, bool active)
@@ -1754,11 +1752,6 @@ static int tb_plug_events_active(struct tb_switch *sw, bool active)
if (tb_switch_is_icm(sw) || tb_switch_is_usb4(sw))
return 0;
- sw->config.plug_events_delay = 0xff;
- res = tb_sw_write(sw, ((u32 *) &sw->config) + 4, TB_CFG_SWITCH, 4, 1);
- if (res)
- return res;
-
res = tb_sw_read(sw, &data, TB_CFG_SWITCH, sw->cap_plug_events + 1, 1);
if (res)
return res;
@@ -2620,7 +2613,8 @@ int tb_switch_configure(struct tb_switch *sw)
tb_route_length(route), sw->config.upstream_port_number);
sw->config.enabled = 1;
-
+ /* Set Notification Timeout to 255 ms for all routers */
+ sw->config.plug_events_delay = 0xff;
if (tb_switch_is_usb4(sw)) {
/*
* For USB4 devices, we need to program the CM version
@@ -2632,7 +2626,6 @@ int tb_switch_configure(struct tb_switch *sw)
sw->config.cmuv = ROUTER_CS_4_CMUV_V1;
else
sw->config.cmuv = ROUTER_CS_4_CMUV_V2;
- sw->config.plug_events_delay = 0xa;
/* Enumerate the switch */
ret = tb_sw_write(sw, (u32 *)&sw->config + 1, TB_CFG_SWITCH,
@@ -2658,7 +2651,7 @@ int tb_switch_configure(struct tb_switch *sw)
/* Enumerate the switch */
ret = tb_sw_write(sw, (u32 *)&sw->config + 1, TB_CFG_SWITCH,
- ROUTER_CS_1, 3);
+ ROUTER_CS_1, 4);
}
if (ret)
return ret;
diff --git a/drivers/thunderbolt/tb_regs.h b/drivers/thunderbolt/tb_regs.h
index 7e65bc9bcb12..f8a84e07969f 100644
--- a/drivers/thunderbolt/tb_regs.h
+++ b/drivers/thunderbolt/tb_regs.h
@@ -182,8 +182,7 @@ struct tb_regs_switch_header {
/* DWORD 4 */
u32 plug_events_delay:8; /*
* RW, pause between plug events in
- * milliseconds. Writing 0x00 is interpreted
- * as 255ms.
+ * milliseconds.
*/
u32 cmuv:8;
u32 __unknown4:8;
--
2.43.0
prev parent reply other threads:[~2026-01-26 22:02 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
2026-01-26 22:06 ` [PATCH 4/5] thunderbolt: Increase timeout to wait for Configuration Ready bit Gil Fine
2026-01-26 22:06 ` Gil Fine [this message]
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=20260126220606.3476657-6-gil.fine@linux.intel.com \
--to=gil.fine@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=gil.fine@intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mika.westerberg@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox