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

Skip to content
Commit 32cf6a37 authored by Pratham Pratap's avatar Pratham Pratap
Browse files

usb: gadget: Clear transfer started flag if endxfer cmd times out



Currently DWC3_EP_TRANSFER_STARTED flag is only cleared when
controller receives DWC3_DEPEVT_EPCMDCMPLT event. Now consider
a case where DWC3_EP_TRANSFER_STARTED is set and composition
switch happened. If DWC3_DEPCMD_ENDTRANSFER command times out
controller will not receive DWC3_DEPEVT_EPCMDCMPLT event and
DWC3_EP_TRANSFER_STARTED flag will not be cleared. Now, if a
function driver(e.g mass storage) tries to dequeue the request,
gadget driver will not giveback the request to function driver
causing it to wait forever for the transfer to be completed.
This can lead the tasks to be in hung state causing a crash.

Fix this by clearing DWC3_EP_TRANSFER_STARTED flag if
DWC3_DEPCMD_ENDTRANSFER command times out.

Change-Id: I712777ef1883de69477705f927fa39c7467921fc
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent b888f0d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment