Skip to content

USB: gadget: atmel: fix transfer of queued requests

Artur Rojek requested to merge kstr_usb_gadget_fix into master

In the existing implementation, multiple requests queued up on an endpoint are subject to getting evicted without being properly transmitted out.

For both control and bulk endpoints, their respective logic found in usba_control_irq()/usba_ep_irq() guarantees that TX FIFO is empty before data is sent out, and that request_complete() gets called once the transfer has been finished. At this point however, if any additional transfers are found on the endpoint queue, they will be processed by submit_next_request(), which makes no checks against the above conditions, trashing data on a busy FIFO and neglecting completion handlers.

Fix the above issues by removing the calls to submit_next_request(), and thus forcing the pending transfers to be processed on the next pass of the respective endpoint irq handlers. While at it, remove a DBG message, as that branch becomes part of regular flow.

This restores mass storage mode operation on SAMA5D27 SoC.

Signed-off-by: Artur Rojek artur@conclusive.pl

Merge request reports

Loading