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

Commit 07193ff8 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: gadget: Fix request completion check"

parents 97ccfd4c 304981d2
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -2992,14 +2992,7 @@ static int dwc3_gadget_ep_reclaim_trb_linear(struct dwc3_ep *dep,

static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req)
{
	/*
	 * For OUT direction, host may send less than the setup
	 * length. Return true for all OUT requests.
	 */
	if (!req->direction)
		return true;

	return req->request.actual == req->request.length;
	return req->num_pending_sgs == 0;
}

static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
@@ -3034,8 +3027,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,

	req->request.actual = req->request.length - req->remaining;

	if (!dwc3_gadget_ep_request_completed(req) ||
			req->num_pending_sgs) {
	if (!dwc3_gadget_ep_request_completed(req)) {
		__dwc3_gadget_kick_transfer(dep);
		goto out;
	}