From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796419602; b=DldwfImVp7IJ2Dqydq9/201m/7QnrEEva9HZMTU6W4g2/3Aef3bGiTXqTIWjqbHkb2SV 1bjx6g179HW3bByG3FCkQM1R6y+DfiCk8Sr3xXXXpgReKLiQMLx2q4guBLxyk+6B4bzL+ fsyCX3+TuPFMwUJswUsjeyvrO/JcsLEItOt8io37qfD0XKVh22//tG20yGYPLcTB+epYL zE+MF+cAACg89X9JcN16pHkZ4oyaqYA8w91R05hRi/vvai5NnaCpSPF5E4EKnoXoouyvS dC0KHXaHm5R3nh9Ld9mvg2m4Y3EkDld9WiNasTyU2FhNZ8uuXq0mNnd3rmZ04BPsrLg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796419602; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=SSk4H8HuWe4cIo8C9iS2HeORX0DXINxagUchG3HXgy4=; b=CKw0gK/Ly2hPoQOvjsf9N7vxWqUcPtHuBd+T5FxCBqntPXKw9YWzate6KkTZMkluQUFD YVV02uwF0S9sKb0Rxe47MIt+ZYKInWZ4yJTupyqo5uap//sL/szT6e+MssJmxPZ0VTq/k ZbhKHu57xnXO9p0GBcfEnoiRoRgNd6TfzUX6tBsDWlLoIeMNygw4gzcVwjwLKw94Wr5Ok hLne48neTvosMAtPBfbtzQaGeErQ/okKzEF01AkA8oQL3/tUyt5sTWbScSE+3UqZQLQOf LigLfJAwd6JetBgdHDTlPcUll/QvsefljrqFyyonPukgibz7v1QEMtb7c0vkwQt9SgA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=f6qA9NgJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09E30606A322 for ; Fri, 4 Dec 2026 21:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=f6qA9NgJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id C78AE1F00936; Fri, 4 Dec 2026 21:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796419601; bh=SSk4H8HuWe4cIo8C9iS2HeORX0DXINxagUchG3HXgy4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=f6qA9NgJht+hYsFrRVBF6H9d55oO68NKixGQkjDk5E/3X4J9Pi1Hz73YDaFEpYT3m CTdAkbfOsM689Rc3F8P5/MVtOxV05Eoi/vBO9PWi0EgDM5pd+tPkowMq6Ds4P+lGft sPbg9I+Kh2QNU3nz/V7iJS/SMSpJpduSIDsU+g9GHRXCld41gfBCpRE9Yqa2dhUOau O+4n64kpzB35aC0I63p393slx8jNq2uKr56UnYO/XT2g/7jpAHFoBvDQehIKmjwAHb Ak2QOtDkuatnwhtbTx2ZXszBGSLl49EC8aNx/gglLtogqRcDuJOzym4Vxh6q1EWkh/ gLAYD9QOuX9hw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] thunderbolt: Always generate the USB4 host router UUID Reply-To: sashiko-reviews@lists.linux.dev To: "Mario Limonciello" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261204-thunderbolt-v2-1-fc467b34c03c@amd.com> References: <20261204-thunderbolt-v2-1-fc467b34c03c@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 21:26:41 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [High] thunderbolt: tb_switch_set_uuid() randomizes ICM USB4 host router UUIDs - [Medium] thunderbolt: random host sw->uuid breaks unique_id ABI and tbnet MACs - [Low] thunderbolt: missing Fixes trailer for commit b04079837b20 -- commit 09c89cff7b2498cf0c5bd0ab40a343cf56fb1578 Author: Mario Limonciello > thunderbolt: Always generate the USB4 host router UUID > > The software connection manager derives the UUID of a USB4 host router > from its UID with the upper two words filled with ones to match what > ICM does. The USB4 spec however requires the Domain UUID used in > inter-domain communication to be generated according to ISO/IEC 9834-8, > and the host router UID is not guaranteed to be unique either. > > If the IDs are not unique then when two of these hosts are connected > together each side sees its own UUID in the inter-domain UUID response, > treats the link as a loop and never bonds the lanes, which caps the > host-to-host link at a single lane. > > Always generate a random UUID for USB4 host routers instead. ICM never > manages USB4 host routers so the ICM compatibility argument does not > apply to them. Device routers and non-USB4 host routers (including > those managed by ICM) keep their existing UUID so their unique_id stays > stable across boots and matches what ICM reports. > > As a side effect the host router unique_id in sysfs and the MAC address > generated by thunderbolt-net (derived from the local Domain UUID) now > change every time a USB4 domain is probed. Update the ABI documentation > accordingly. > > Signed-off-by: Mario Limonciello [Severity: Low] This looks like a bug fix for USB4 host-to-host inter-domain links when host router UIDs are not unique. Should this include: Fixes: b04079837b20 ("thunderbolt: Add initial support for USB4") > diff --git a/Documentation/ABI/testing/sysfs-bus-thunderbolt b/Documentat= ion/ABI/testing/sysfs-bus-thunderbolt > index 4c954cb6b5e41..f0f7302613267 100644 > --- a/Documentation/ABI/testing/sysfs-bus-thunderbolt > +++ b/Documentation/ABI/testing/sysfs-bus-thunderbolt > @@ -192,6 +192,10 @@ Description: This attribute contains unique_id strin= g of this device. > newer hardware) or based on UID from the device DROM. > Can be used to uniquely identify particular device. > =20 > + For USB4 host routers this is a randomly generated > + Domain UUID as required by the USB4 specification and > + it changes every time the domain is probed. [Severity: Medium] Can the sysfs unique_id ABI break be avoided by storing a separate Domain UUID on struct tb instead of overwriting tb->root_switch->uuid? unique_id_show() exposes sw->uuid as unique_id, so randomizing it breaks stability across boots for tools like boltd, fwupd, and udev. In the software connection manager, only tb_scan_xdomain() and tb_xdp_handle_request() use it for inter-domain traffic. Also, tbnet_generate_mac() hashes xd->local_uuid and calls eth_hw_addr_set() without setting NET_ADDR_RANDOM, so thunderbolt-net MACs now change on every probe while still reporting a permanent address. This ABI text is also inaccurate for ICM-managed Intel USB4 hosts (Tiger Lake, Alder Lake, Raptor Lake, Meteor Lake), where icm_icl_set_uuid() populates sw->uuid from PCI config registers. [ ... ] > diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c > index 8899fea713ac2..a693cf123e71b 100644 > --- a/drivers/thunderbolt/switch.c > +++ b/drivers/thunderbolt/switch.c > @@ -2873,10 +2873,23 @@ static int tb_switch_set_uuid(struct tb_switch *s= w) > return 0; > =20 > if (tb_switch_is_usb4(sw)) { > - ret =3D usb4_switch_read_uid(sw, &sw->uid); > - if (ret) > - return ret; > - uid =3D true; > + if (!tb_route(sw)) { > + /* > + * USB4 spec requires the Domain UUID to be > + * generated according to ISO/IEC 9834-8 so never > + * derive it from the host router UID. The UID is > + * not guaranteed to be unique either (it can be > + * left unprogrammed) and if two hosts end up with > + * the same UUID the inter-domain link is mistaken > + * for a loop and lanes are never bonded. > + */ > + generate_random_uuid((u8 *)uuid); [Severity: High] Does this break XDomain discovery and Thunderbolt-IP networking on ICM-managed USB4 host routers such as Intel Maple Ridge? Contrary to the commit message, icm_probe() manages several Intel USB4 host controllers, and Maple Ridge 2C/4C leaves icm->set_uuid NULL. In icm_start(), sw->uuid is still NULL when tb_switch_add() reaches tb_switch_set_uuid(), so it now assigns a random UUID on every probe. Under ICM, icm_tr_xdomain_connected() sets xd->local_uuid from firmware, while tb_xdp_handle_request() replies to UUID_REQUEST with the random tb->root_switch->uuid. Peer PROPERTIES_REQUEST packets then fail with ERROR_UNKNOWN_DOMAIN and tbnet_handle_packet() drops Thunderbolt-IP. Checking !tb_switch_is_icm(sw) here and scoping the commit message and ABI doc to software connection manager USB4 hosts would avoid this regression. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-thunderbol= t-v2-1-fc467b34c03c@amd.com?part=3D1