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

Commit ce7ff8b6 authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3-msm: Use pm_runtime_put_sync_suspend()



With data role swap (e.g. UFP -> DFP), USB doesn't go into LPM
while stopping UFP mode. This results into no enumeration of
connected USB device in DFP mode.
pm_runtime_put_sync() performs 2 operations:
a. rpm_idle()
b. rpm_suspend() with rpmflags set with AUTO

USB device sets use_autosuspend to true with its power device.
Hence rpm_suspend() exits with updating pm_suspend_timer_fn()
to suspend device in future time. USB driver does have requirement
to make sure that USB always goes through LPM whenever there is
data role change. Hence replace usage of pm_runtime_put_sync()
by pm_runtime_sync_suspend() which calls USB driver suspend
functionality without considering autosuspend flag.

Change-Id: Ie4fff17376626ec27e07af7ee6e22c59ba0c00fb
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent fc9ce0e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4070,7 +4070,7 @@ static void dwc3_otg_sm_work(struct work_struct *w)
			 * which was incremented upon cable connect in
			 * OTG_STATE_B_IDLE state
			 */
			pm_runtime_put_sync(mdwc->dev);
			pm_runtime_put_sync_suspend(mdwc->dev);
			dbg_event(0xFF, "!BSV psync",
				atomic_read(&mdwc->dev->power.usage_count));
			work = 1;