OSDN Git Service

usb: dwc2: Add core state checking
authorGrigor Tovmasyan <Grigor.Tovmasyan@synopsys.com>
Wed, 24 Jan 2018 13:44:25 +0000 (17:44 +0400)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 13 Mar 2018 08:47:49 +0000 (10:47 +0200)
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>
drivers/usb/dwc2/gadget.c

index 706fecf..d67f9ae 100644 (file)
@@ -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;
        }