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

Commit 3aa03791 authored by Manu Gautam's avatar Manu Gautam
Browse files

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: default avatarManu Gautam <mgautam@codeaurora.org>
parent 755d9a0a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2166,6 +2166,9 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
				msecs_to_jiffies(DWC3_PULL_UP_TIMEOUT));
		if (ret == 0) {
			dev_err(dwc->dev, "timed out waiting for SETUP phase\n");
			pm_runtime_put_autosuspend(dwc->dev);
			dbg_event(0xFF, "Pullup timeout put",
				atomic_read(&dwc->dev->power.usage_count));
			return -ETIMEDOUT;
		}
	}