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

Commit 4a915f89 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: dwc3-msm: Flush bus_vote_w work on pm_suspend and freeze



Currently as a part of dwc3_msm_pm_suspend, driver calls suspend
routine which schedules bus_vote_w to remove bus votes from USB.
But it could be possible that the system freezes before the work
function could get called or completed. This will keep the USB
votes enabled and block XO shutdown.
Fix this by flushing the bus_vote_w at the end of pm_suspend to
ensure that bus votes are removed.

Change-Id: I578e3c4434eb04740f07f4dd0640a945a86fde8b
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 51abefff
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -4059,10 +4059,13 @@ static int dwc3_msm_pm_suspend(struct device *dev)
	}

	ret = dwc3_msm_suspend(mdwc, false);
	if (!ret)
	if (ret)
		return ret;

	flush_work(&mdwc->bus_vote_w);
	atomic_set(&mdwc->pm_suspended, 1);

	return ret;
	return 0;
}

static int dwc3_msm_pm_freeze(struct device *dev)
@@ -4091,10 +4094,13 @@ static int dwc3_msm_pm_freeze(struct device *dev)
	mdwc->hs_phy->flags &= ~PHY_HOST_MODE;

	ret = dwc3_msm_suspend(mdwc, true);
	if (!ret)
	if (ret)
		return ret;

	flush_work(&mdwc->bus_vote_w);
	atomic_set(&mdwc->pm_suspended, 1);

	return ret;
	return 0;
}

static int dwc3_msm_pm_resume(struct device *dev)