Patchwork [1/6] PM / Domains: Improve warn for multiple states but no governor in genpd

login
register
mail settings
Submitter Dong Aisheng
Date March 6, 2019, 1:25 p.m.
Message ID <1551878302-8146-2-git-send-email-aisheng.dong@nxp.com>
Download mbox | patch
Permalink /patch/742511/
State New
Headers show

Comments

Dong Aisheng - March 6, 2019, 1:25 p.m.
It's possible a PM domain defines only one state and it does not need
a governor to work. For such case, a warning actually is not necessary.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/base/power/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Ulf Hansson - March 6, 2019, 2:17 p.m.
On Wed, 6 Mar 2019 at 14:25, Aisheng Dong <aisheng.dong@nxp.com> wrote:
>
> It's possible a PM domain defines only one state and it does not need
> a governor to work. For such case, a warning actually is not necessary.
>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

Fixes: 2c9b7f877203 ("PM / Domains: Deal with multiple states but no
governor in genpd")
Cc: stable@vger.kernel.org

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

> ---
>  drivers/base/power/domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 2c334c0..394f9da 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1766,7 +1766,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
>                 ret = genpd_set_default_power_state(genpd);
>                 if (ret)
>                         return ret;
> -       } else if (!gov) {
> +       } else if (!gov && genpd->state_count > 1) {
>                 pr_warn("%s : no governor for states\n", genpd->name);
>         }
>
> --
> 2.7.4
>
Dong Aisheng - March 7, 2019, 1:57 p.m.
> From: Ulf Hansson [mailto:ulf.hansson@linaro.org]

> Sent: Wednesday, March 6, 2019 10:17 PM

> On Wed, 6 Mar 2019 at 14:25, Aisheng Dong <aisheng.dong@nxp.com>

> wrote:

> >

> > It's possible a PM domain defines only one state and it does not need

> > a governor to work. For such case, a warning actually is not necessary.

> >

> > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

> 

> Fixes: 2c9b7f877203 ("PM / Domains: Deal with multiple states but no

> governor in genpd")

> Cc: stable@vger.kernel.org

> 

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

> 


One question, this patch applies for current situation, but when we add two states
support with no governor (see my another patch series to support enter
deepest state for suspend but intermediate state for runtime pm), 
here will still warn.

Do you think if we should totally remove this warning or keep this patch
but change to use another simple governor later for multi states?
e.g. fixed intermediate state for runtime pm?

Regards
Dong Aisheng

> > ---

> >  drivers/base/power/domain.c | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c

> > index 2c334c0..394f9da 100644

> > --- a/drivers/base/power/domain.c

> > +++ b/drivers/base/power/domain.c

> > @@ -1766,7 +1766,7 @@ int pm_genpd_init(struct generic_pm_domain

> *genpd,

> >                 ret = genpd_set_default_power_state(genpd);

> >                 if (ret)

> >                         return ret;

> > -       } else if (!gov) {

> > +       } else if (!gov && genpd->state_count > 1) {

> >                 pr_warn("%s : no governor for states\n", genpd->name);

> >         }

> >

> > --

> > 2.7.4

> >

Patch

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 2c334c0..394f9da 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1766,7 +1766,7 @@  int pm_genpd_init(struct generic_pm_domain *genpd,
 		ret = genpd_set_default_power_state(genpd);
 		if (ret)
 			return ret;
-	} else if (!gov) {
+	} else if (!gov && genpd->state_count > 1) {
 		pr_warn("%s : no governor for states\n", genpd->name);
 	}