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

Commit a89cab3e authored by Sujeev Dias's avatar Sujeev Dias
Browse files

mhi: controller: qcom: fix unbalance runtime enable counts



A bug in MHI system suspend function caused the function to exit
prematurely without disabling runtime suspend. The subsequent
runtime resume caused unbalance enable count.

CRs-Fixed: 2291885
Change-Id: I9f45a86fff2caf4ba13236677d1325e7093a1947
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent bdd63def
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -257,12 +257,18 @@ static int mhi_system_resume(struct device *dev)
int mhi_system_suspend(struct device *dev)
{
	struct mhi_controller *mhi_cntrl = dev_get_drvdata(dev);
	int ret;

	MHI_LOG("Entered\n");

	/* if rpm status still active then force suspend */
	if (!pm_runtime_status_suspended(dev))
		return mhi_runtime_suspend(dev);
	if (!pm_runtime_status_suspended(dev)) {
		ret = mhi_runtime_suspend(dev);
		if (ret) {
			MHI_LOG("suspend failed ret:%d\n", ret);
			return ret;
		}
	}

	pm_runtime_set_suspended(dev);
	pm_runtime_disable(dev);