On Thu, 2014-09-04 at 13:22 +0530, Viresh Kumar wrote:
On 4 September 2014 13:13, Yuantian Tang Yuantian.Tang@freescale.com wrote:
OK, I see. Seems like we don't have choice but make it bool.
I am quite surprised that the architecture doesn't provide such macros.
I have added few powerpc guys (Mostly Maintainers) to check what would it take to get such a macro..
What we want: A routine/macro that returns mask of all CPUs/threads sharing clock line.
What do you mean by "clock line" ? This is a very .... odd concept here. On P8 we have a reference clock (well several) going into the package, which can contain multiple dies, which contain multiple cores which can operate at different frequencies but it's not really a "clock line".
And every implementation out there would do things differently. I don't know what Freescale does but you can't compare.
The architecture doesn't provide such a macro because the link between cpufreq entity is a cpufreq specific concept. For example we could have a chip where cores have pstate by pairs but otherwise are completely independent. So it's up to the cpufreq driver for the given platform to handle that.
I don't see how we could provide a "macro" ... we might be able to represent the pstate domains in some way and provide some kind of architecture function for that but it wouldn't be a macro. It happens that today on P8 we control the pstates per core but that might not be always the case for example.
cpu_core_mask() gives something similar but only for online CPUs, and we want that for online+offline CPUs.
Correct.
Btw, another powerpc driver is doing this: drivers/cpufreq/powernv-cpufreq.c
base = cpu_first_thread_sibling(policy->cpu); for (i = 0; i < threads_per_core; i++) cpumask_set_cpu(base + i, policy->cpus);
Will this work for you as
That's P8 native. It currently use the core as the entity but that probably needs to be improved based on some device-tree property for long term solidity.
Ben.
well ?