usb: dwc3: gadget: Fix TRB chaining for SG requests
In dwc3_prepare_trbs() when handling requests with scatter-gather
enabled, we must make sure to perform the check of whether the
request is the last one in the list *before* looping over the
scatterlist. This is because the dwc3_prepare_one_trb() call has
a side effect of moving the request to the req_queued list, so
after that point checking if it's still in the request_list is
invalid. This causes the last TRB to not have either its last
or chain bits set when queueing to the hardware which can result
in the function driver not getting any completion notification
of the queued request.
Change-Id: If3dbd068cef0cf0e66255dc8bc8fa45a1ee85b0c
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment