lkml.org 
[lkml]   [2020]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1] arch_topology: Adjust initial CPU capacities with current freq
On Thu, Jan 09, 2020 at 03:52:14PM +0800, Jeffy Chen wrote:
> The CPU freqs are not supposed to change before cpufreq policies
> properly registered, meaning that they should be used to calculate the
> initial CPU capacities.
>
> Doing this helps choosing the best CPU during early boot, especially
> for the initramfs decompressing.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

[...]

> @@ -146,10 +153,15 @@ bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
> return false;
> }
> }
> - capacity_scale = max(cpu_capacity, capacity_scale);
> raw_capacity[cpu] = cpu_capacity;
> pr_debug("cpu_capacity: %pOF cpu_capacity=%u (raw)\n",
> cpu_node, raw_capacity[cpu]);
> +
> + cpu_clk = of_clk_get(cpu_node, 0);
> + if (!PTR_ERR_OR_ZERO(cpu_clk))
> + per_cpu(max_freq, cpu) = clk_get_rate(cpu_clk) / 1000;
> +
> + clk_put(cpu_clk);

I don't like to assume DVFS to be supplied only using 'clk'. So NACK!
We have other non-clk mechanism for CPU DVFS and this needs to simply
use cpufreq APIs to get frequency value if required.

--
Regards,
Sudeep

\
 
 \ /
  Last update: 2020-01-10 12:38    [W:0.088 / U:8.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site