summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2
diff options
context:
space:
mode:
authorGrigor Tovmasyan <Grigor.Tovmasyan@synopsys.com>2018-01-24 17:44:25 +0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-13 10:47:49 +0200
commit88b02f2cb1e13e1ab161c5cb2d5c69f76fe05be2 (patch)
tree5dbb1e472ccc46939201b4194e0ced1fa9670e59 /drivers/usb/dwc2
parentc655557c12ded72a41a8d04e868a10b74d957f22 (diff)
downloadlinux-88b02f2cb1e13e1ab161c5cb2d5c69f76fe05be2.tar.gz
linux-88b02f2cb1e13e1ab161c5cb2d5c69f76fe05be2.tar.bz2
linux-88b02f2cb1e13e1ab161c5cb2d5c69f76fe05be2.zip
usb: dwc2: Add core state checking
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>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r--drivers/usb/dwc2/gadget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 706fecf16b52..d67f9aeedf84 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -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;
}