Skip to contentSkip to conversation

soc: mediatek: SCPSYS: Fix double enabling of regulators

PATCH New Sascha Hauer 3 participants 3 messages Jan 22, 2016 – Feb 1, 2016 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: mediatek: SCPSYS: Fix double enabling of regulators

With CONFIG_PM enabled do not call genpd->power_on manually as this will cause the regulators being turned on once in SCPSYS probe and then again when the genpd core turns on the domains. Instead, call genpd->power_on only with CONFIG_PM disabled and tell the genpd core that the domains are disabled when registered.

---
 drivers/soc/mediatek/mtk-scpsys.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/soc/mediatek/mtk-scpsys.c +5 -6
index 0221387..78227db 100644
@@ -500,14 +500,13 @@ static int __init scpsys_probe(struct platform_device *pdev)
 		genpd->dev_ops.active_wakeup = scpsys_active_wakeup;
 
 		/*
-		 * Initially turn on all domains to make the domains usable
-		 * with !CONFIG_PM and to get the hardware in sync with the
-		 * software.  The unused domains will be switched off during
-		 * late_init time.
+		 * With CONFIG_PM disabled turn on all domains to make the
+		 * hardware usable.
 		 */
-		genpd->power_on(genpd);
+		if (!IS_ENABLED(CONFIG_PM))
+			genpd->power_on(genpd);
 
-		pm_genpd_init(genpd, NULL, false);
+		pm_genpd_init(genpd, NULL, true);
 	}
 
 	/*
Signature · 1 line
2.7.0.rc3
#1 lore raw

PATCH 1/1 soc: mediatek: SCPSYS: Fix double enabling of regulators

Quoted 8 lines · Sascha Hauer

With CONFIG_PM enabled do not call genpd->power_on manually as this will cause the regulators being turned on once in SCPSYS probe and then again when the genpd core turns on the domains. Instead, call genpd->power_on only with CONFIG_PM disabled and tell the genpd core that the domains are disabled when registered.

Take your pick:

Quoted 31 lines
---
 drivers/soc/mediatek/mtk-scpsys.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/soc/mediatek/mtk-scpsys.c +5 -7
index 0221387..78227db 100644
@@ -500,14 +500,13 @@ static int __init scpsys_probe(struct platform_device *pdev)
                genpd->dev_ops.active_wakeup = scpsys_active_wakeup;
 
                /*
-                * Initially turn on all domains to make the domains usable
-                * with !CONFIG_PM and to get the hardware in sync with the
-                * software.  The unused domains will be switched off during
-                * late_init time.
+                * With CONFIG_PM disabled turn on all domains to make the
+                * hardware usable.
                 */
-               genpd->power_on(genpd);
+               if (!IS_ENABLED(CONFIG_PM))
+                       genpd->power_on(genpd);
 
-               pm_genpd_init(genpd, NULL, false);
+               pm_genpd_init(genpd, NULL, true);
        }
 
        /*
--

2.7.0.rc3

maintainer Applied
#2 lore raw

PATCH 1/1 soc: mediatek: SCPSYS: Fix double enabling of regulators

Quoted 8 lines · Daniel Kurtz
Quoted 7 lines · Sascha Hauer
Quoted 7 lines

With CONFIG_PM enabled do not call genpd->power_on manually as this will cause the regulators being turned on once in SCPSYS probe and then again when the genpd core turns on the domains. Instead, call genpd->power_on only with CONFIG_PM disabled and tell the genpd core that the domains are disabled when registered.

Quoted 6 lines
Quoted 1 line
Quoted 1 line

Take your pick:

Quoted 1 line
Quoted 1 line

---

Applied, thanks.