linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM: domains: log failures to register always-on domains
@ 2022-09-29 15:42 Johan Hovold
  2022-09-29 23:57 ` Kevin Hilman
  2022-09-30 10:38 ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Johan Hovold @ 2022-09-29 15:42 UTC (permalink / raw)
  To: Rafael J. Wysocki, Kevin Hilman, Ulf Hansson
  Cc: Greg Kroah-Hartman, Matthias Kaehlcke, linux-pm, linux-kernel,
	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).

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 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


diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index bbfbf05b3446..7200e307effb 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] PM: domains: log failures to register always-on domains
  2022-09-29 15:42 [PATCH] PM: domains: log failures to register always-on domains Johan Hovold
@ 2022-09-29 23:57 ` Kevin Hilman
  2022-09-30 10:38 ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2022-09-29 23:57 UTC (permalink / raw)
  To: Johan Hovold, Rafael J. Wysocki, Ulf Hansson
  Cc: Greg Kroah-Hartman, Matthias Kaehlcke, linux-pm, linux-kernel,
	Johan Hovold

Johan Hovold <johan+linaro@kernel.org> writes:

> 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).
>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Reviewed-by: Kevin Hilman <khilman@baylibre.com>

> ---
>  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
>
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index bbfbf05b3446..7200e307effb 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PM: domains: log failures to register always-on domains
  2022-09-29 15:42 [PATCH] PM: domains: log failures to register always-on domains Johan Hovold
  2022-09-29 23:57 ` Kevin Hilman
@ 2022-09-30 10:38 ` Ulf Hansson
  2022-10-04 14:27   ` Rafael J. Wysocki
  1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2022-09-30 10:38 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Rafael J. Wysocki, Kevin Hilman, Greg Kroah-Hartman,
	Matthias Kaehlcke, linux-pm, linux-kernel

On Thu, 29 Sept 2022 at 17:42, Johan Hovold <johan+linaro@kernel.org> wrote:
>
> 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).
>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  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
>
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index bbfbf05b3446..7200e307effb 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PM: domains: log failures to register always-on domains
  2022-09-30 10:38 ` Ulf Hansson
@ 2022-10-04 14:27   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2022-10-04 14:27 UTC (permalink / raw)
  To: Ulf Hansson, Johan Hovold
  Cc: Rafael J. Wysocki, Kevin Hilman, Greg Kroah-Hartman,
	Matthias Kaehlcke, linux-pm, linux-kernel

On Fri, Sep 30, 2022 at 12:39 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Thu, 29 Sept 2022 at 17:42, Johan Hovold <johan+linaro@kernel.org> wrote:
> >
> > 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).
> >
> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Applied as 6.1-rc material, thanks!

> > ---
> >  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
> >
> >
> > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> > index bbfbf05b3446..7200e307effb 100644
> > --- a/drivers/base/power/domain.c
> > +++ b/drivers/base/power/domain.c
> > @@ -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
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-04 14:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 15:42 [PATCH] PM: domains: log failures to register always-on domains Johan Hovold
2022-09-29 23:57 ` Kevin Hilman
2022-09-30 10:38 ` Ulf Hansson
2022-10-04 14:27   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).