Skip to content

Commit 51189eb

Browse files
tmlindstorulf
authored andcommitted
mmc: sdhci-omap: Fix a lockdep warning for PM runtime init
We need runtime PM enabled early in probe before sdhci_setup_host() for sdhci_omap_set_capabilities(). But on the first runtime resume we must not call sdhci_runtime_resume_host() as sdhci_setup_host() has not been called yet. Let's check for an initialized controller like we already do for context restore to fix a lockdep warning. Fixes: f433e8a ("mmc: sdhci-omap: Implement PM runtime functions") Reported-by: Yegor Yefremov <yegorslists@googlemail.com> Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Tony Lindgren <tony@atomide.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220622051215.34063-1-tony@atomide.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 3234649 commit 51189eb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/mmc/host/sdhci-omap.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,8 +1298,9 @@ static int sdhci_omap_probe(struct platform_device *pdev)
12981298
/*
12991299
* omap_device_pm_domain has callbacks to enable the main
13001300
* functional clock, interface clock and also configure the
1301-
* SYSCONFIG register of omap devices. The callback will be invoked
1302-
* as part of pm_runtime_get_sync.
1301+
* SYSCONFIG register to clear any boot loader set voltage
1302+
* capabilities before calling sdhci_setup_host(). The
1303+
* callback will be invoked as part of pm_runtime_get_sync.
13031304
*/
13041305
pm_runtime_use_autosuspend(dev);
13051306
pm_runtime_set_autosuspend_delay(dev, 50);
@@ -1441,7 +1442,8 @@ static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev)
14411442
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
14421443
struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);
14431444

1444-
sdhci_runtime_suspend_host(host);
1445+
if (omap_host->con != -EINVAL)
1446+
sdhci_runtime_suspend_host(host);
14451447

14461448
sdhci_omap_context_save(omap_host);
14471449

@@ -1458,10 +1460,10 @@ static int __maybe_unused sdhci_omap_runtime_resume(struct device *dev)
14581460

14591461
pinctrl_pm_select_default_state(dev);
14601462

1461-
if (omap_host->con != -EINVAL)
1463+
if (omap_host->con != -EINVAL) {
14621464
sdhci_omap_context_restore(omap_host);
1463-
1464-
sdhci_runtime_resume_host(host, 0);
1465+
sdhci_runtime_resume_host(host, 0);
1466+
}
14651467

14661468
return 0;
14671469
}

0 commit comments

Comments
 (0)