MLK16557 soc:imx8qm/imx8qx - Resources can request low power idle mode only when...
authorRanjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Thu, 28 Sep 2017 18:48:23 +0000 (13:48 -0500)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:53 +0000 (15:38 -0500)
Some drivers use runtime PM callbacks during suspend/resume also and this
in turn results in SCFW calls requesting the resource to enter
low power idle instead OFF state.
This patch fixes this issue by ensuring that low power IDLE request is only
valid when runtime PM is enabled. Runtime PM is disabled when the system is
entering suspend state.

BuildInfo: SCFW 7a725203, IMX-MKIMAGE ee6adff0, ATF 0

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
drivers/soc/imx/pm-domains.c

index 5626315..a99883a 100644 (file)
@@ -133,7 +133,8 @@ static int imx8_pd_dev_stop(struct device *dev)
        struct imx8_pm_domain *pd;
 
        pd = container_of(genpd, struct imx8_pm_domain, pd);
-       pd->runtime_idle_active = true;
+       if (pm_runtime_enabled(dev))
+               pd->runtime_idle_active = true;
        return 0;
 }
 
@@ -143,7 +144,8 @@ static int imx8_pm_runtime_idle(struct device *dev)
        struct imx8_pm_domain *pd;
 
        pd = container_of(genpd, struct imx8_pm_domain, pd);
-       pd->runtime_idle_active = true;
+       if (pm_runtime_enabled(dev))
+               pd->runtime_idle_active = true;
        return pm_runtime_autosuspend(dev);
 }