mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
usb: dwc3: gadget: handle ep_dequeue in LPM properly
Currently, the driver is relying on remove_requests or ep_dequeue to giveback the requests to function driver, but when the stop active transfer is called it will return with error status and will bail out from remove request without clearing the requests. At this point we rely on ep_dequeue to clear those requests, but since usb is disconnected, it will be in LPM which would drive dequeue to bailout without clearing the requests. Fix this by removing the LPM check from dequeue to stop_active_transfer. Now if dequeue process proceeds will check in stop_active_transfer, if dwc3 is in lpm bail out from the process. Dequeue will further proceed & clean up the request from cancelled list. Change-Id: I13628ab96059fbae14bed64056ff8d7561cd240f Signed-off-by: Udipto Goswami <ugoswami@codeaurora.org>
This commit is contained in:
parent
03d2764796
commit
5a97f31248
1 changed files with 5 additions and 5 deletions
|
|
@ -1805,11 +1805,6 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
|
|||
unsigned long flags;
|
||||
int ret = 0;
|
||||
|
||||
if (atomic_read(&dwc->in_lpm)) {
|
||||
dev_err(dwc->dev, "Unable to dequeue while in LPM\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
trace_dwc3_ep_dequeue(req);
|
||||
dbg_ep_dequeue(dep->number, req);
|
||||
|
||||
|
|
@ -3533,6 +3528,11 @@ int dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, bool interrupt)
|
|||
u32 cmd;
|
||||
int ret;
|
||||
|
||||
if (atomic_read(&dwc->in_lpm)) {
|
||||
dev_err(dwc->dev, "cannot stop transfers while in LPM\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(dep->flags & DWC3_EP_TRANSFER_STARTED) ||
|
||||
(dep->flags & DWC3_EP_END_TRANSFER_PENDING))
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue