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

Commit be7605c7 authored by Manu Gautam's avatar Manu Gautam
Browse files

USB: ci13xxx: Bail out from ep fifo_flush if USB in LPM



Function drivers might call ep fifo_flush in LPM. Bail
out with error message if so to avoid unclocked access
in case there is any pending response.

Change-Id: I99816a13b4492f73d2c210c2bbe46f27d0870700
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 62290451
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3370,6 +3370,7 @@ static int ep_set_wedge(struct usb_ep *ep)
 */
static void ep_fifo_flush(struct usb_ep *ep)
{
	struct ci13xxx *udc = _udc;
	struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
	unsigned long flags;

@@ -3380,6 +3381,13 @@ static void ep_fifo_flush(struct usb_ep *ep)
		return;
	}

	if (udc->udc_driver->in_lpm && udc->udc_driver->in_lpm(udc)) {
		dev_err(udc->transceiver->dev,
				"%s: Unable to fifo_flush while in LPM\n",
				__func__);
		return;
	}

	spin_lock_irqsave(mEp->lock, flags);

	dbg_event(_usb_addr(mEp), "FFLUSH", 0);