From: Michal Pecio <michal.pecio@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Brent Page <brentfpage@gmail.com>, linux-usb@vger.kernel.org
Subject: Re: TT budgeting for EHCI; accommodate 1023-byte full-speed isochronous–in endpoints
Date: Wed, 29 Apr 2026 11:36:04 +0200 [thread overview]
Message-ID: <20260429113604.2204b646.michal.pecio@gmail.com> (raw)
In-Reply-To: <32291bf6-0c9d-4fd9-9dd7-489f7e1c9f02@rowland.harvard.edu>
> On Mon, Apr 27, 2026 at 06:24:58PM -0700, Brent Page wrote:
> > I recently encountered the ENOSPC error mentioned here
> > (https://lkml.org/lkml/2013/2/19/482) when trying to communicate
> > with a full-speed peripheral with one isochronous–in endpoint with
> > a wMaxPacketSize of 1023. N.b., that patch was reverted
> > (https://lkml.org/lkml/2013/6/18/458). I think it should be tried
> > again with a different approach.
Out of curiosity, what sort of device? This bug used to annoy me too at
one point, but my device was a DSL modem, not easy to experiment with.
On Tue, 28 Apr 2026 17:19:01 -0400, Alan Stern wrote:
> Section 11.18.1 is a marvel of inconsistency. The text and the
> figure caption say that the estimate assumes no bit-stuffing, but the
> formula clearly includes a 6/7 bit-stuffing factor.
I don't think it's inconsistent, it makes sense the way you explain.
> I think what it means is that the maximum number of periodic data
> bytes that can be scheduled for one frame on a full-speed bus is
> 1157, since transaction scheduling does have to take bit-stuffing
> into account. See the formulas in section 5.11.3. Even that value
> is an overestimate, because it does not reserve time for packet
> headers and other forms of overhead. Figure 11-60 shows the
> budgeting estimate for those 1157 bytes, under the assumption that
> they do not need to be bit-stuffed.
The host must schedule SSPLITs assuming no bit-stuffing to prevent TT
buffer underrun on long OUT packets. Assuming minimum/no packet headers
further minimizes downstream idle. TTs are required to buffer this.
(BTW, periodic transfers should occur before async. Could the TT run
out of periodic, do async, then get an unexpected periodic transaction
in the next uframe? What happens?)
Including packet headers for SSPLIT scheduling seems harmless unless
overestimated, but apparently it's not required. TTs must cope.
Separately, for go/no-go (ENOSPC) decisions, the host should consider
all overhead in order to guarantee >10% downstream time for async.
Max payload is still close to 1157 because it may be just two packets.
That's how I see it.
> Since the value of stream->ps.tt_usecs calculated in
> iso_stream_init() does include the 7/6 bit-stuffing factor, it makes
> sense to adjust the us-per-uframe values to reverse that effect for
> purposes of budgeting. It would be more in the spirit of the spec to
> do the budgeting in terms of bytes rather than microseconds, but
> since it's all estimates anyway this shouldn't matter.
Not entirely sure about it, *if* these computations are later used to
schedule SSPLIT or CSPLIT transactions. That needs to be exact IMO.
Does anyone understand why the previous attempt at enabling 1023 byte
isoc IN resulted in isoc OUT corruption?
BTW, does ehci-hcd support scheduling CSPLITs to Y0 of the next frame?
It's an edge case which likely won't occur with one 1023 byte endpoint,
but it may occur with more periodic endpoints and unlucky bit stuffing
or with periodic BW limit carefully increased for testing purposes.
Regards,
Michal
next prev parent reply other threads:[~2026-04-29 9:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 1:24 TT budgeting for EHCI; accommodate 1023-byte full-speed isochronous–in endpoints Brent Page
2026-04-28 21:19 ` Alan Stern
2026-04-29 9:36 ` Michal Pecio [this message]
2026-04-29 11:58 ` Michal Pecio
2026-04-29 17:56 ` Alan Stern
2026-04-29 19:24 ` Michal Pecio
2026-04-29 19:32 ` Alan Stern
2026-04-29 19:52 ` Brent Page
2026-04-30 2:27 ` Alan Stern
2026-04-30 6:46 ` Brent Page
2026-04-29 20:04 ` Michal Pecio
2026-04-30 1:47 ` Alan Stern
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=20260429113604.2204b646.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=brentfpage@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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