Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
Re: sys/xhci: avoid clear to zero maxBurst for Enhanced SuperSpeed
To:
phessler@theapt.org, tech@openbsd.org
Date:
Fri, 06 Nov 2026 14:28:27 +0100

Download raw body.

Thread
On Fri, 06 Nov 2026 14:20:28 +0100,
Jeremie Courreges-Anglas <jca@wxcvbn.org> wrote:
> 
> On Fri, Nov 06, 2026 at 02:06:26PM +0100, Kirill A. Korinsky wrote:
> > On Fri, 06 Nov 2026 13:54:12 +0100,
> > Peter Hessler <phessler@theapt.org> wrote:
> > > 
> > > On 2026 Nov 06 (Fri) at 11:54:32 +0100 (+0100), Kirill A. Korinsky wrote:
> > > :tech@,
> > > :
> > > :I'm reading xhci and nearby to understand why ure is capped to ~1.5 Gbit and
> > > :so far I think I had spolied one missed case in xhci.
> 
> Does it help ure(4) speed?
>

Nope, it does not. So, here somethign else.

> > > :Section 6.2.3.4 of eXtensible Host Controller Interface for Universal Serial
> > > :Bus states that for for Enhanced SuperSpeed endpoints maxBurts for all
> > > :endpoints should be setup into bMaxBurst. At least I read it this way. See
> > > :page 455 here:
> > > :https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf
> > > :
> > > :Am I wrong?
> > > :
> > > 
> > > Reading the spec it says all endpoints (transfer types), so I think the
> > > check should simply be
> > > "if (esscd)"
> > > 
> > > Or if you want to specifically exclude control endpoints, then use
> > > "if (esscd && xfertype != UE_CONTROL)"
> > > 
> > 
> > Thanks for suggestion.
> > 
> > Yes, I think if esscd is that is actually written in the spec.
> 
> As discussed in the hackroom the spec also pretends the value ought to
> be between 0 and 15.  I'm not sure we should try to cap it at 16 or
> keep the code as is.
> 
> Diff LGTM but untested.
> 

Yes, I think this is the right way because bMaxBurst is uByte

Index: sys/dev/usb/xhci.c
===================================================================
RCS file: /home/cvs/src/sys/dev/usb/xhci.c,v
diff -u -p -r1.136 xhci.c
--- sys/dev/usb/xhci.c	1 Mar 2025 14:43:03 -0000	1.136
+++ sys/dev/usb/xhci.c	6 Nov 2026 13:22:01 -0000
@@ -1455,9 +1455,14 @@ xhci_pipe_maxburst(struct usbd_pipe *pip
 			maxb = UE_GET_TRANS(mps);
 		break;
 	case USB_SPEED_SUPER:
-		if (esscd &&
-		    (xfertype == UE_ISOCHRONOUS || xfertype == UE_INTERRUPT))
+		/*
+		 * Section 6.2.3.4 xHCI requires to use bMaxBurst for
+		 * all endpoints for Enhanced SuperSpeed;
+		 * and section 9.6.7 USB 3.0 keeps bMaxBurst between 0 15
+ 		 * */
+		if (esscd && esscd->bMaxBurst < 16)
 			maxb = esscd->bMaxBurst;
+		break;
 	default:
 		break;
 	}


-- 
wbr, Kirill