[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:
venkatesh.pallipadi@intel.com
2008-08-04 11:59:07 -07:00
committed by Dave Jones
parent 8217e4f4c9
commit bf0b90e357
4 changed files with 12 additions and 8 deletions

View File

@ -256,7 +256,8 @@ static u32 get_cur_val(const cpumask_t *mask)
* Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
* no meaning should be associated with absolute values of these MSRs.
*/
static unsigned int get_measured_perf(unsigned int cpu)
static unsigned int get_measured_perf(struct cpufreq_policy *policy,
unsigned int cpu)
{
union {
struct {
@ -326,7 +327,7 @@ static unsigned int get_measured_perf(unsigned int cpu)
#endif
retval = per_cpu(drv_data, cpu)->max_freq * perf_percent / 100;
retval = per_cpu(drv_data, policy->cpu)->max_freq * perf_percent / 100;
put_cpu();
set_cpus_allowed_ptr(current, &saved_mask);