Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f15271c7 authored by Jack Pham's avatar Jack Pham Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarJack Pham <jackp@codeaurora.org>
parent 2e7c3098
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment