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

Commit 922f640c authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3: gadget: Avoid starting next transfer if transfer is active



XFERNOTREADY event provides status about current transfer. Hence
if transfer is active, then avoid starting next transfer by calling
__dwc3_gadget_kick_transfer() API. Otherwise USB controller stalls to
perform data transfer on that endpoint due to starting new transfer
without completing in progress transfer.

Change-Id: I90370e7e5de55b499a78fbfe5e913f39ec22c7e5
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 4c47f344
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2602,6 +2602,14 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
					? "Transfer Active"
					: "Transfer Not Active");

			/*
			 * If XFERNOTREADY interrupt is received with event
			 * status as TRANSFER ACTIVE, don't kick next transfer.
			 * otherwise data stall is seen on that endpoint.
			 */
			if (event->status & DEPEVT_STATUS_TRANSFER_ACTIVE)
				return;

			ret = __dwc3_gadget_kick_transfer(dep, 0, 1);
			if (!ret || ret == -EBUSY)
				return;