[PATCH 1/2] usb: core: hub: recognise two-lane SuperSpeed sublinks as Gen 1x2

From: Kean Ren

Date: Sat Sep 19 2026 - 22:54:30 EST


get_port_ssp_rate() rejects every matching sublink speed attribute whose
link protocol (LP) is not SuperSpeedPlus by jumping to the "unknown"
exit before it looks at the number of active lanes.

USB 3.2 Gen 1x2 runs two SuperSpeed (Gen 1) lanes, so the matching
sublink entry advertises LP = SuperSpeed while two lanes are in use.
The current code therefore returns USB_SSP_GEN_UNKNOWN for such a link
and the USB core falls back to USB_SPEED_SUPER, reporting 5000 Mbps.

Handle the two-lane cases before rejecting non-SuperSpeedPlus entries:

>= 10 Gbps per lane and 2 lanes -> USB_SSP_GEN_2x2
>= 5 Gbps per lane and 2 lanes -> USB_SSP_GEN_1x2

so that a genuine Gen 1x2 link is reported as 10000 Mbps instead of
5000 Mbps.

Signed-off-by: Kean Ren <rh_king@xxxxxxx>
---
drivers/usb/core/hub.c | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 3345b3298daf..50f14dd6a41f 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2866,10 +2866,6 @@ static enum usb_ssp_rate get_port_ssp_rate(struct usb_device *hdev,
type == USB_SSP_SUBLINK_SPEED_ST_ASYM_TX)
goto out;

- if (FIELD_GET(USB_SSP_SUBLINK_SPEED_LP, attr) !=
- USB_SSP_SUBLINK_SPEED_LP_SSP)
- goto out;
-
lse = FIELD_GET(USB_SSP_SUBLINK_SPEED_LSE, attr);
mantissa = FIELD_GET(USB_SSP_SUBLINK_SPEED_LSM, attr);

@@ -2877,14 +2873,28 @@ static enum usb_ssp_rate get_port_ssp_rate(struct usb_device *hdev,
for (; lse < USB_SSP_SUBLINK_SPEED_LSE_GBPS; lse++)
mantissa /= 1000;

- if (mantissa >= 10 && lanes == 1)
- return USB_SSP_GEN_2x1;
+ /*
+ * Two active lanes mean USB 3.2 dual-lane operation.
+ * A Gen 1x2 link uses SuperSpeed (Gen 1) signalling on
+ * both lanes, so its sublink entry advertises the
+ * SuperSpeed link protocol rather than SuperSpeedPlus.
+ * Handle the two-lane cases before rejecting entries
+ * that do not advertise SuperSpeedPlus.
+ */
+ if (lanes == 2) {
+ if (mantissa >= 10)
+ return USB_SSP_GEN_2x2;
+ if (mantissa >= 5)
+ return USB_SSP_GEN_1x2;
+ goto out;
+ }

- if (mantissa >= 10 && lanes == 2)
- return USB_SSP_GEN_2x2;
+ if (FIELD_GET(USB_SSP_SUBLINK_SPEED_LP, attr) !=
+ USB_SSP_SUBLINK_SPEED_LP_SSP)
+ goto out;

- if (mantissa >= 5 && lanes == 2)
- return USB_SSP_GEN_1x2;
+ if (mantissa >= 10)
+ return USB_SSP_GEN_2x1;

goto out;
}