[CPUFREQ][1/6] cpufreq: Add cpu number parameter to __cpufreq_driver_getavg()
Add a cpu parameter to __cpufreq_driver_getavg(). This is needed for software cpufreq coordination where policy->cpu may not be same as the CPU on which we want to getavg frequency. A follow-on patch will use this parameter to getavg freq from all cpus in policy->cpus. Change since last patch. Fix the offline/online and suspend/resume oops reported by Youquan Song <youquan.song@intel.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:

committed by
Dave Jones

parent
8217e4f4c9
commit
bf0b90e357
@@ -1487,7 +1487,7 @@ no_policy:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cpufreq_driver_target);
|
||||
|
||||
int __cpufreq_driver_getavg(struct cpufreq_policy *policy)
|
||||
int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -1495,8 +1495,8 @@ int __cpufreq_driver_getavg(struct cpufreq_policy *policy)
|
||||
if (!policy)
|
||||
return -EINVAL;
|
||||
|
||||
if (cpu_online(policy->cpu) && cpufreq_driver->getavg)
|
||||
ret = cpufreq_driver->getavg(policy->cpu);
|
||||
if (cpu_online(cpu) && cpufreq_driver->getavg)
|
||||
ret = cpufreq_driver->getavg(policy, cpu);
|
||||
|
||||
cpufreq_cpu_put(policy);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user