Skip to content
Commit c5a7092f authored by Michael Olbrich's avatar Michael Olbrich Committed by Felipe Balbi
Browse files

usb: dwc3: gadget: make starting isoc transfers more robust



Currently __dwc3_gadget_start_isoc must be called very shortly after
XferNotReady. Otherwise the frame number is outdated and start transfer
will fail, even with several retries.

DSTS provides the lower 14 bit of the frame number. Use it in combination
with the frame number provided by XferNotReady to guess the current frame
number. This will succeed unless more than one 14 rollover has happened
since XferNotReady.

Start transfer might still fail if the frame number is increased
immediately after DSTS is read. So retries are still needed.
Don't drop the current request if this happens. This way it is not lost and
can be used immediately to try again with the next frame number.

With this change, __dwc3_gadget_start_isoc is still not successfully in all
cases bit it increases the acceptable delay after XferNotReady
significantly.

Reviewed-by: default avatarThinh Nguyen <thinhn@synopsys.com>
Signed-off-by: default avatarMichael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent ca143785
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment