On 9 January 2013 21:09, Viresh Kumar viresh.kumar@linaro.org wrote:
On 9 January 2013 16:50, Viresh Kumar viresh.kumar@linaro.org wrote:
[Probably need to simplify cpufreq_add_dev() too, but that can be done as next step.]
I have tried that too, it is also pushed at:
https://lkml.org/lkml/2012/12/16/5
[Untested for now, will be doing it tomorrow]
From: Viresh Kumar viresh.kumar@linaro.org Date: Wed, 9 Jan 2013 21:02:50 +0530 Subject: [PATCH] cpufreq: Simplify cpufreq_add_dev()
Currently cpufreq_add_dev() firsts allocated policy, calls ->init() and then checks if this cpu should be already managed or not. And if it already managed, free its policy.
We can save all this if we somehow know if this cpu is managed or not in advance. policy->related_cpus contains list of all valid sibling cpus of policy->cpu. We can check this to know if current cpu is already managed.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
Tested-by: Viresh Kumar viresh.kumar@linaro.org