[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
@ -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);
|
||||
|
Reference in New Issue
Block a user