Skip to contentSkip to conversation

PM: domains: log failures to register always-on domains

PATCH Applied Johan Hovold 4 participants 4 messages Sep 29, 2022 – Oct 4, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: domains: log failures to register always-on domains

Always-on PM domains must be on during initialisation or the domain is currently silently rejected.

Print an error message in case an always-on domain is not on to make it easier to debug drivers getting this wrong (e.g. by setting an always-on genpd flag without making sure that the state matches).

---
 drivers/base/power/domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Both myself and Matthias have hit this with the Qualcomm GCC drivers when updating static genpd flags directly instead of using/adding driver specific flags to propagate the setting.

Johan

drivers/base/power/domain.c +3 -1
index bbfbf05b3446..7200e307effb 100644
@@ -2087,8 +2087,10 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
 
 	/* Always-on domains must be powered on at initialization. */
 	if ((genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd)) &&
-			!genpd_status_on(genpd))
+			!genpd_status_on(genpd)) {
+		pr_err("always-on PM domain %s is not on\n", genpd->name);
 		return -EINVAL;
+	}
 
 	/* Multiple states but no governor doesn't make sense. */
 	if (!gov && genpd->state_count > 1)
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Johan Hovold

Always-on PM domains must be on during initialisation or the domain is currently silently rejected.

Print an error message in case an always-on domain is not on to make it easier to debug drivers getting this wrong (e.g. by setting an always-on genpd flag without making sure that the state matches).

Quoted 30 lines
---
 drivers/base/power/domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Both myself and Matthias have hit this with the Qualcomm GCC drivers when updating static genpd flags directly instead of using/adding driver specific flags to propagate the setting.

Johan

drivers/base/power/domain.c +3 -1
index bbfbf05b3446..7200e307effb 100644
@@ -2087,8 +2087,10 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
 
 	/* Always-on domains must be powered on at initialization. */
 	if ((genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd)) &&
-			!genpd_status_on(genpd))
+			!genpd_status_on(genpd)) {
+		pr_err("always-on PM domain %s is not on\n", genpd->name);
 		return -EINVAL;
+	}
 
 	/* Multiple states but no governor doesn't make sense. */
 	if (!gov && genpd->state_count > 1)
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

Always-on PM domains must be on during initialisation or the domain is currently silently rejected.

Print an error message in case an always-on domain is not on to make it easier to debug drivers getting this wrong (e.g. by setting an always-on genpd flag without making sure that the state matches).

Kind regards
Uffe

Quoted 31 lines
---
 drivers/base/power/domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Both myself and Matthias have hit this with the Qualcomm GCC drivers when updating static genpd flags directly instead of using/adding driver specific flags to propagate the setting.

Johan

drivers/base/power/domain.c +3 -2
index bbfbf05b3446..7200e307effb 100644
@@ -2087,8 +2087,10 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
 
        /* Always-on domains must be powered on at initialization. */
        if ((genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd)) &&
-                       !genpd_status_on(genpd))
+                       !genpd_status_on(genpd)) {
+               pr_err("always-on PM domain %s is not on\n", genpd->name);
                return -EINVAL;
+       }
 
        /* Multiple states but no governor doesn't make sense. */
        if (!gov && genpd->state_count > 1)
--

2.35.1

maintainer Applied
#3 lore raw
Quoted 6 lines · Ulf Hansson
Quoted 4 lines · Johan Hovold

Always-on PM domains must be on during initialisation or the domain is currently silently rejected.

Quoted 7 lines
Quoted 5 lines

Print an error message in case an always-on domain is not on to make it easier to debug drivers getting this wrong (e.g. by setting an always-on genpd flag without making sure that the state matches).

Applied as 6.1-rc material, thanks!

Quoted 31 lines
Quoted 31 lines
---
 drivers/base/power/domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Both myself and Matthias have hit this with the Qualcomm GCC drivers when updating static genpd flags directly instead of using/adding driver specific flags to propagate the setting.

Johan

drivers/base/power/domain.c +3 -2
index bbfbf05b3446..7200e307effb 100644
@@ -2087,8 +2087,10 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
 
        /* Always-on domains must be powered on at initialization. */
        if ((genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd)) &&
-                       !genpd_status_on(genpd))
+                       !genpd_status_on(genpd)) {
+               pr_err("always-on PM domain %s is not on\n", genpd->name);
                return -EINVAL;
+       }
 
        /* Multiple states but no governor doesn't make sense. */
        if (!gov && genpd->state_count > 1)
--

2.35.1