> interesting. We actually found a similar issue with XHCI. scatterlist
> has to be aligned to wMaxPacketSize but only before a link TRB. Mathias
> has been working on a solution which involves memcpy()ing enough bytes
> to align to wMaxPacketSize before the link TRB (it's very infrequent as
> we have 256 TRBs per segment on XHCI), but if you know of a nicer way,
> we're all ears :-)

That is a restriction of the xhci interface.
Link TRBs are only valid on USB buffer boundaries.
There is also the limitation that each TRB buffer can't
cross a 64k boundary.
Both require the TRB list be constructed very carefully.
(Having read the spec very carefully first.)

Possibly requiring backtracking (even aborting the URB itself)
since it is hard to work out beforehand how many TRB are needed.

If a link TRB would cross a USB packet boundary you could go back
to the previous boundary, cut the buffer and add the link TRB there.

Using 8 bytes of immediate data (instead of a pointer) in the TRB
may be a way out of the worst case scenario - it allows almost 2k
of data in 256 TRBs.

        David

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to