Subject: Re: [PATCH v1 1/2] powernv: cpufreq driver for powernv platform

From: Preeti U Murthy <[email-masked]>
Date: Tue, 11 Feb 2014 14:07:30 +0530

Hi Vaidy,

On 02/11/2014 12:32 PM, Vaidyanathan Srinivasan wrote:
> Backend driver to dynamically set voltage and frequency on
> IBM POWER non-virtualized platforms.  Power management SPRs
> are used to set the required PState.
> 
> This driver works in conjunction with cpufreq governors
> like 'ondemand' to provide a demand based frequency and
> voltage setting on IBM POWER non-virtualized platforms.
> 
> PState table is obtained from OPAL v3 firmware through device
> tree.
> 
> powernv_cpufreq back-end driver would parse the relevant device-tree
> nodes and initialise the cpufreq subsystem on powernv platform.
> 
> Signed-off-by: Vaidyanathan Srinivasan <[email-masked]>
> Signed-off-by: Srivatsa S. Bhat <[email-masked]>
> Signed-off-by: Anton Blanchard <[email-masked]>
> ---
<snip>

> +static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
> +{
> +	int base, i;
> +
> +#ifdef CONFIG_SMP
> +	base = cpu_first_thread_sibling(policy->cpu);
> +
> +	for (i = 0; i < threads_per_core; i++)
> +		cpumask_set_cpu(base + i, policy->cpus);
> +#endif
> +	policy->cpuinfo.transition_latency = 25000;

Is it ok to hard code this field? How about getting this also from the
device tree?

> +
> +	/* Print frequency table */
> +	for (i = 0; powernv_freqs[i].frequency != CPUFREQ_TABLE_END; i++)
> +		pr_debug("%d: %d\n", i, powernv_freqs[i].frequency);

The frequency table as a result will be printed on every cpu when
cpufreq gets initialized. Considering this information will not vary
across CPUs, can we print this during powernv_cpufreq_init() after
parsing the device tree for the pstates?

Thanks

Regards
Preeti U Murthy