Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

From: Viresh Kumar
Date: Thu Jun 26 2014 - 22:26:47 EST


On 27 June 2014 05:36, Stephen Boyd <sboyd@xxxxxxxxxxxxxx> wrote:
> I gave it a spin. It looks mostly good except for the infinite loop:

Great !!

> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
> index b7ee67c4d1c0..6744321ae33d 100644
> --- a/drivers/cpufreq/cpufreq-cpu0.c
> +++ b/drivers/cpufreq/cpufreq-cpu0.c
> @@ -138,8 +138,10 @@ try_again:
> }
>
> /* Try with "cpu-supply" */
> - if (reg == reg_cpu0)
> + if (reg == reg_cpu0) {
> + reg = reg_cpu;
> goto try_again;
> + }
>
> dev_warn(cpu_dev, "failed to get cpu%d regulator: %ld\n",
> cpu, PTR_ERR(cpu_reg));

Awesome code, I wrote it. Thanks for fixing it.

> and I think we just want reg_cpu to be "cpu", not "cpu-supply" because I
> think the regulator core adds in the "-supply" part already.

Okay.

> After fixing that I can get cpufreq going. I'm currently working on
> populating the OPPs at runtime without relying on DT. So eventually I'll
> need this patch:

I see..

> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
> index b7ee67c4d1c0..6744321ae33d 100644
> --- a/drivers/cpufreq/cpufreq-cpu0.c
> +++ b/drivers/cpufreq/cpufreq-cpu0.c
> @@ -239,11 +241,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy)
> }
>
> ret = of_init_opp_table(cpu_dev);
> - if (ret) {
> - dev_err(cpu_dev, "failed to init OPP table: %d\n", ret);
> - goto out_put_node;
> - }
> -
> ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
> if (ret) {
> dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
>
> which I hope is ok.

I need to see details of these routines once again, but will surely make
it work for you.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/