Re: [PATCH v5 1/2] usb: core: Pair ports of different hubs through their connector
From: Alan Stern
Date: Wed Nov 18 2026 - 10:11:37 EST
On Wed, Nov 18, 2026 at 04:34:58AM +0000, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
>
> On the RK3588, USB 3.0 host 2 is SuperSpeed-only and its connector's
> USB 2.0 lines go to a separate EHCI, so pairing by port number gives the
> SuperSpeed port a dead USB 2.0 peer.
>
> When ports 0 (USB 2.0) and 1 (SuperSpeed) of a usb-connector graph lead
> to different hubs, pair them through the connector. Root hub ports are
> found by the controller port number; graphs in the dwc3 numbering don't
> match and keep today's pairing. connect_type is looked up the same way,
> so such a SuperSpeed port reads "hotplug".
>
> Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
> ---
> drivers/usb/core/hub.h | 2 ++
> drivers/usb/core/of.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++
> drivers/usb/core/port.c | 70 ++++++++++++++++++++++++++++++++++++---
> include/linux/usb/of.h | 8 +++++
> 4 files changed, 162 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
> index 9ebc5ef54a32..a186c41bdb5e 100644
> --- a/drivers/usb/core/hub.h
> +++ b/drivers/usb/core/hub.h
> @@ -97,6 +97,7 @@ struct usb_hub {
> * @usb3_lpm_u2_permit: whether USB3 U2 LPM is permitted.
> * @early_stop: whether port initialization will be stopped earlier.
> * @ignore_event: whether events of the port are ignored.
> + * @connector_peer: peer found through a connector.
> */
> struct usb_port {
> struct usb_device *child;
> @@ -118,6 +119,7 @@ struct usb_port {
> unsigned int is_superspeed:1;
> unsigned int usb3_lpm_u1_permit:1;
> unsigned int usb3_lpm_u2_permit:1;
> + bool connector_peer;
> };
Minor point: It looks silly to see a standalone bool field immediately
after a bunch of single-bit fields. The new connector_peer field should
also be a single bit, to match the others.
Alan Stern