diff mbox series

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

Message ID 1551878302-8146-2-git-send-email-aisheng.dong@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show
Series PM / Domains: A few clean up and minor fixes | expand

Commit Message

Aisheng Dong March 6, 2019, 1:25 p.m. UTC
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(-)

Comments

Ulf Hansson March 6, 2019, 2:17 p.m. UTC | #1
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
>
Aisheng Dong March 7, 2019, 1:57 p.m. UTC | #2
> 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
> >
diff mbox series

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);
 	}