@@ -68,6 +68,7 @@ struct acpi_cpufreq_data {
68
68
unsigned int max_freq ;
69
69
unsigned int resume ;
70
70
unsigned int cpu_feature ;
71
+ u64 saved_aperf , saved_mperf ;
71
72
};
72
73
73
74
static DEFINE_PER_CPU (struct acpi_cpufreq_data * , drv_data );
@@ -259,9 +260,6 @@ static long read_measured_perf_ctrs(void *_cur)
259
260
rdmsr (MSR_IA32_APERF , cur -> aperf .split .lo , cur -> aperf .split .hi );
260
261
rdmsr (MSR_IA32_MPERF , cur -> mperf .split .lo , cur -> mperf .split .hi );
261
262
262
- wrmsr (MSR_IA32_APERF , 0 , 0 );
263
- wrmsr (MSR_IA32_MPERF , 0 , 0 );
264
-
265
263
return 0 ;
266
264
}
267
265
@@ -281,13 +279,20 @@ static long read_measured_perf_ctrs(void *_cur)
281
279
static unsigned int get_measured_perf (struct cpufreq_policy * policy ,
282
280
unsigned int cpu )
283
281
{
284
- struct perf_pair cur ;
282
+ struct perf_pair readin , cur ;
285
283
unsigned int perf_percent ;
286
284
unsigned int retval ;
287
285
288
- if (!work_on_cpu (cpu , read_measured_perf_ctrs , & cur ))
286
+ if (!work_on_cpu (cpu , read_measured_perf_ctrs , & readin ))
289
287
return 0 ;
290
288
289
+ cur .aperf .whole = readin .aperf .whole -
290
+ per_cpu (drv_data , cpu )-> saved_aperf ;
291
+ cur .mperf .whole = readin .mperf .whole -
292
+ per_cpu (drv_data , cpu )-> saved_mperf ;
293
+ per_cpu (drv_data , cpu )-> saved_aperf = readin .aperf .whole ;
294
+ per_cpu (drv_data , cpu )-> saved_mperf = readin .mperf .whole ;
295
+
291
296
#ifdef __i386__
292
297
/*
293
298
* We dont want to do 64 bit divide with 32 bit kernel
0 commit comments