usb: dwc3: gadget: Fix runtime PM vote from pull_up handler

If gadget driver's request for removing pull_up fails due to
EP0 not in setup phase, then driver ends up bailing out
without removing it PM usage_count vote.
This will prevent DWC3 from entering low power mode and
subsequent start_peripheral/host would also won't be
allowed as LPM entry is mandatory for that.

Change-Id: Id1dde0dcf379a1f6b9567d63c0b1d31445c30d0d
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
Manu Gautam 2019-02-27 08:50:12 +05:30 • committed by Jack Pham
commit 90f8961b8a

View file

@ -2078,10 +2078,8 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
ret = wait_for_completion_timeout(&dwc->ep0_in_setup,
msecs_to_jiffies(DWC3_PULL_UP_TIMEOUT));
if (ret == 0) {
if (ret == 0)
dev_err(dwc->dev, "timed out waiting for SETUP phase\n");
return -ETIMEDOUT;
}
}
spin_lock_irqsave(&dwc->lock, flags);