Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88b02f2c authored by Grigor Tovmasyan's avatar Grigor Tovmasyan Committed by Felipe Balbi
Browse files

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: default avatarGrigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent c655557c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1297,8 +1297,8 @@ static int dwc2_hsotg_ep_queue(struct usb_ep *ep, struct usb_request *req,
		req->zero, req->short_not_ok);
		req->zero, req->short_not_ok);


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