[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhSdy0=jvJ-Gqx7CEeRS+ZSBS8mEaZiZ1vT5p=47n=p3wBaBw@mail.gmail.com>
Date: Sat, 14 May 2022 22:17:20 +0530
From: Anup Patel <anup@...infault.org>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: "Rafael J . Wysocki" <rjw@...ysocki.net>,
"open list:THERMAL" <linux-pm@...r.kernel.org>,
Sudeep Holla <sudeep.holla@....com>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
Maulik Shah <quic_mkshah@...cinc.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Atish Patra <atishp@...osinc.com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] cpuidle: riscv-sbi: Fix code to allow a genpd
governor to be used
On Sat, May 14, 2022 at 8:50 PM Ulf Hansson <ulf.hansson@...aro.org> wrote:
>
> The intent is to use a genpd governor when there are some states that needs
> to be managed. Although, the current code ends up to never assign a
> governor, let's fix this.
>
> Fixes: 6abf32f1d9c50 ("cpuidle: Add RISC-V SBI CPU idle driver")
> Signed-off-by: Ulf Hansson <ulf.hansson@...aro.org>
Looks good to me. I have tested this on QEMU RISC-V as well.
Reviewed-by: Anup Patel <anup@...infault.org>
Tested-by: Anup Patel <anup@...infault.org>
Thanks,
Anup
> ---
> drivers/cpuidle/cpuidle-riscv-sbi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c
> index b459eda2cd37..478970fa3b0c 100644
> --- a/drivers/cpuidle/cpuidle-riscv-sbi.c
> +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c
> @@ -413,7 +413,7 @@ static int sbi_pd_init(struct device_node *np)
> struct generic_pm_domain *pd;
> struct sbi_pd_provider *pd_provider;
> struct dev_power_governor *pd_gov;
> - int ret = -ENOMEM, state_count = 0;
> + int ret = -ENOMEM;
>
> pd = dt_idle_pd_alloc(np, sbi_dt_parse_state_node);
> if (!pd)
> @@ -432,7 +432,7 @@ static int sbi_pd_init(struct device_node *np)
> pd->flags |= GENPD_FLAG_ALWAYS_ON;
>
> /* Use governor for CPU PM domains if it has some states to manage. */
> - pd_gov = state_count > 0 ? &pm_domain_cpu_gov : NULL;
> + pd_gov = pd->states ? &pm_domain_cpu_gov : NULL;
>
> ret = pm_genpd_init(pd, pd_gov, false);
> if (ret)
> --
> 2.25.1
>
Powered by blists - more mailing lists