mmc: msm_sdcc: Fix issue with runtime PM resume
Due to the changes introduced in recent commit 68338b, runtime PM
resume is getting called twice while doing platform resume as below -
msmsdcc_pm_resume()->msmsdcc_runtime_resume()->mmc_resume_host()
->mmc_claim_host()->msmsdcc_enable()->msmsdcc_runtime_resume
This patch fixes this issue by checking the runtime PM state of
the device before resuming.
CRs-Fixed: 303742
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index c6fab3c..0800059 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -4119,20 +4119,13 @@
if (host->plat->is_sdio_al_client)
return 0;
- rc = msmsdcc_runtime_resume(dev);
+ if (!pm_runtime_suspended(dev))
+ rc = msmsdcc_runtime_resume(dev);
if (host->plat->status_irq) {
msmsdcc_check_status((unsigned long)host);
enable_irq(host->plat->status_irq);
}
- /* Update the run-time PM status */
- pm_runtime_disable(dev);
- rc = pm_runtime_set_active(dev);
- if (rc < 0)
- pr_info("%s: %s: failed with error %d", mmc_hostname(mmc),
- __func__, rc);
- pm_runtime_enable(dev);
-
return rc;
}