Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142830
b: refs/heads/master
c: 18b2646
h: refs/heads/master
v: v3
  • Loading branch information
Venkatesh Pallipadi authored and Len Brown committed Apr 7, 2009
1 parent f852ea8 commit c2486b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4f6937222dbb61b8b8e62caca3d32e648b3b14b
refs/heads/master: 18b2646fe3babeb40b34a0c1751e0bf5adfdc64c
15 changes: 10 additions & 5 deletions trunk/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct acpi_cpufreq_data {
unsigned int max_freq;
unsigned int resume;
unsigned int cpu_feature;
u64 saved_aperf, saved_mperf;
};

static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data);
Expand Down Expand Up @@ -259,9 +260,6 @@ static long read_measured_perf_ctrs(void *_cur)
rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi);
rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi);

wrmsr(MSR_IA32_APERF, 0, 0);
wrmsr(MSR_IA32_MPERF, 0, 0);

return 0;
}

Expand All @@ -281,13 +279,20 @@ static long read_measured_perf_ctrs(void *_cur)
static unsigned int get_measured_perf(struct cpufreq_policy *policy,
unsigned int cpu)
{
struct perf_pair cur;
struct perf_pair readin, cur;
unsigned int perf_percent;
unsigned int retval;

if (!work_on_cpu(cpu, read_measured_perf_ctrs, &cur))
if (!work_on_cpu(cpu, read_measured_perf_ctrs, &readin))
return 0;

cur.aperf.whole = readin.aperf.whole -
per_cpu(drv_data, cpu)->saved_aperf;
cur.mperf.whole = readin.mperf.whole -
per_cpu(drv_data, cpu)->saved_mperf;
per_cpu(drv_data, cpu)->saved_aperf = readin.aperf.whole;
per_cpu(drv_data, cpu)->saved_mperf = readin.mperf.whole;

#ifdef __i386__
/*
* We dont want to do 64 bit divide with 32 bit kernel
Expand Down

0 comments on commit c2486b7

Please sign in to comment.