Skip to content

Commit

Permalink
usb: dwc2: Add core state checking
Browse files Browse the repository at this point in the history
Added core state checking in dwc2_hsotg_ep_queue() function
to make sure that application will submit requests only in L0 state.

Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Grigor Tovmasyan authored and Felipe Balbi committed Mar 13, 2018
1 parent c655557 commit 88b02f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/dwc2/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,8 @@ static int dwc2_hsotg_ep_queue(struct usb_ep *ep, struct usb_request *req,
req->zero, req->short_not_ok);

/* Prevent new request submission when controller is suspended */
if (hs->lx_state == DWC2_L2) {
dev_dbg(hs->dev, "%s: don't submit request while suspended\n",
if (hs->lx_state != DWC2_L0) {
dev_dbg(hs->dev, "%s: submit request only in active state\n",
__func__);
return -EAGAIN;
}
Expand Down

0 comments on commit 88b02f2

Please sign in to comment.