usb: dwc3: gadget: Clear req->unaligned/zero flags on cleanup
OUT endpoint requests may somtimes have either req->unaligned
or req->zero set indicating that there is an additional TRB
linked to the request. If that request ends up being removed
before getting completed (e.g. due to ep_dequeue or ep_disable),
those flags are not cleared when dwc3_gadget_giveback() is
called. If the request is then requeued for a new transfer that
does not require an extra TRB and it is successfully completed,
dwc3_cleanup_done_reqs() will incorrectly process the additional
TRB which belongs to the next request, and incorrectly advances
the TRB dequeue pointer, which messes up calculation of the
next requeust's actual/remaining when it completes.
Fix this by always clearing req->unaligned & req->zero in
dwc3_gadget_del_and_unmap_request().
Change-Id: Ice394bf40a08fe71e743d801c77338daccc02a7e
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment