mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
usb: dwc3: Don't queue the request if gadget is in suspended state
Do not queue the request when gadget is in suspended state as usb controller cannot process the request queued. Change-Id: Id83b8461f208c6fc72b27105233e453dd8697528 Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
This commit is contained in:
parent
9e1aed8fb7
commit
7e2497c8e0
1 changed files with 11 additions and 0 deletions
|
|
@ -1616,6 +1616,14 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
|
|||
return __dwc3_gadget_kick_transfer(dep);
|
||||
}
|
||||
|
||||
static bool dwc3_gadget_is_suspended(struct dwc3 *dwc)
|
||||
{
|
||||
if (atomic_read(&dwc->in_lpm) ||
|
||||
dwc->link_state == DWC3_LINK_STATE_U3)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
|
||||
gfp_t gfp_flags)
|
||||
{
|
||||
|
|
@ -1627,6 +1635,9 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
|
|||
|
||||
int ret;
|
||||
|
||||
if (dwc3_gadget_is_suspended(dwc))
|
||||
return -EAGAIN;
|
||||
|
||||
spin_lock_irqsave(&dwc->lock, flags);
|
||||
ret = __dwc3_gadget_ep_queue(dep, req);
|
||||
spin_unlock_irqrestore(&dwc->lock, flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue