diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-08 18:32:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-08 18:32:06 -0400 |
commit | 7b85a88ca7760d6d5f34bdaa793c71d921a3e853 (patch) | |
tree | 821b9860f85ca49bc6fc7a58642b7d1faff8f2fb /arch | |
parent | 139ef17a464a222aadf7b543d734a4001d06b720 (diff) | |
parent | 8897c1859521cf33077256725b2377164b130c75 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
x86 ACPI: Add support for Always Running APIC timer
ACPI x86: Make aperf/mperf MSR access in acpi_cpufreq read_only
ACPI x86: Cleanup acpi_cpufreq structures related to aperf/mperf
ACPICA: delete check for AML access to port 0x81-83
ACPI: WMI: use .notify method instead of installing handler directly
sony-laptop: use .notify method instead of installing handler directly
panasonic-laptop: use .notify method instead of installing handler directly
fujitsu-laptop: use .notify method instead of installing hotkey handler directly
fujitsu-laptop: use .notify method instead of installing handler directly
ACPI: video: use .notify method instead of installing handler directly
ACPI: thermal: use .notify method instead of installing handler directly
ACPI battery: fix async boot oops
ACPI: delete acpi_device.g_list
NULL noise: drivers/platform/x86/panasonic-laptop.c
ACPI: cpufreq: remove dupilcated #include
ACPI: Adjust Kelvin offset to match local implementation
ACPI: convert acpi_device_lock spinlock to mutex
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/cpufeature.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/addon_cpuid_features.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 55 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/longhaul.c | 1 |
5 files changed, 37 insertions, 27 deletions
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 0beba0d1468d..bb83b1c397aa 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -154,6 +154,7 @@ | |||
154 | * CPUID levels like 0x6, 0xA etc | 154 | * CPUID levels like 0x6, 0xA etc |
155 | */ | 155 | */ |
156 | #define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */ | 156 | #define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */ |
157 | #define X86_FEATURE_ARAT (7*32+ 1) /* Always Running APIC Timer */ | ||
157 | 158 | ||
158 | /* Virtualization flags: Linux defined */ | 159 | /* Virtualization flags: Linux defined */ |
159 | #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */ | 160 | #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */ |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 098ec84b8c00..f2870920f246 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -431,6 +431,12 @@ static void __cpuinit setup_APIC_timer(void) | |||
431 | { | 431 | { |
432 | struct clock_event_device *levt = &__get_cpu_var(lapic_events); | 432 | struct clock_event_device *levt = &__get_cpu_var(lapic_events); |
433 | 433 | ||
434 | if (cpu_has(¤t_cpu_data, X86_FEATURE_ARAT)) { | ||
435 | lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP; | ||
436 | /* Make LAPIC timer preferrable over percpu HPET */ | ||
437 | lapic_clockevent.rating = 150; | ||
438 | } | ||
439 | |||
434 | memcpy(levt, &lapic_clockevent, sizeof(*levt)); | 440 | memcpy(levt, &lapic_clockevent, sizeof(*levt)); |
435 | levt->cpumask = cpumask_of(smp_processor_id()); | 441 | levt->cpumask = cpumask_of(smp_processor_id()); |
436 | 442 | ||
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index 8220ae69849d..c965e5212714 100644 --- a/arch/x86/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c | |||
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
31 | 31 | ||
32 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { | 32 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { |
33 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 }, | 33 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 }, |
34 | { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 }, | ||
34 | { 0, 0, 0, 0 } | 35 | { 0, 0, 0, 0 } |
35 | }; | 36 | }; |
36 | 37 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 19f6b9d27e83..9d3af380c6bd 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -68,6 +68,7 @@ struct acpi_cpufreq_data { | |||
68 | unsigned int max_freq; | 68 | unsigned int max_freq; |
69 | unsigned int resume; | 69 | unsigned int resume; |
70 | unsigned int cpu_feature; | 70 | unsigned int cpu_feature; |
71 | u64 saved_aperf, saved_mperf; | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); | 74 | static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); |
@@ -241,26 +242,23 @@ static u32 get_cur_val(const struct cpumask *mask) | |||
241 | return cmd.val; | 242 | return cmd.val; |
242 | } | 243 | } |
243 | 244 | ||
244 | struct perf_cur { | 245 | struct perf_pair { |
245 | union { | 246 | union { |
246 | struct { | 247 | struct { |
247 | u32 lo; | 248 | u32 lo; |
248 | u32 hi; | 249 | u32 hi; |
249 | } split; | 250 | } split; |
250 | u64 whole; | 251 | u64 whole; |
251 | } aperf_cur, mperf_cur; | 252 | } aperf, mperf; |
252 | }; | 253 | }; |
253 | 254 | ||
254 | 255 | ||
255 | static long read_measured_perf_ctrs(void *_cur) | 256 | static long read_measured_perf_ctrs(void *_cur) |
256 | { | 257 | { |
257 | struct perf_cur *cur = _cur; | 258 | struct perf_pair *cur = _cur; |
258 | 259 | ||
259 | rdmsr(MSR_IA32_APERF, cur->aperf_cur.split.lo, cur->aperf_cur.split.hi); | 260 | rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi); |
260 | rdmsr(MSR_IA32_MPERF, cur->mperf_cur.split.lo, cur->mperf_cur.split.hi); | 261 | rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi); |
261 | |||
262 | wrmsr(MSR_IA32_APERF, 0, 0); | ||
263 | wrmsr(MSR_IA32_MPERF, 0, 0); | ||
264 | 262 | ||
265 | return 0; | 263 | return 0; |
266 | } | 264 | } |
@@ -281,52 +279,57 @@ static long read_measured_perf_ctrs(void *_cur) | |||
281 | static unsigned int get_measured_perf(struct cpufreq_policy *policy, | 279 | static unsigned int get_measured_perf(struct cpufreq_policy *policy, |
282 | unsigned int cpu) | 280 | unsigned int cpu) |
283 | { | 281 | { |
284 | struct perf_cur cur; | 282 | struct perf_pair readin, cur; |
285 | unsigned int perf_percent; | 283 | unsigned int perf_percent; |
286 | unsigned int retval; | 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 | return 0; | 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 | #ifdef __i386__ | 296 | #ifdef __i386__ |
292 | /* | 297 | /* |
293 | * We dont want to do 64 bit divide with 32 bit kernel | 298 | * We dont want to do 64 bit divide with 32 bit kernel |
294 | * Get an approximate value. Return failure in case we cannot get | 299 | * Get an approximate value. Return failure in case we cannot get |
295 | * an approximate value. | 300 | * an approximate value. |
296 | */ | 301 | */ |
297 | if (unlikely(cur.aperf_cur.split.hi || cur.mperf_cur.split.hi)) { | 302 | if (unlikely(cur.aperf.split.hi || cur.mperf.split.hi)) { |
298 | int shift_count; | 303 | int shift_count; |
299 | u32 h; | 304 | u32 h; |
300 | 305 | ||
301 | h = max_t(u32, cur.aperf_cur.split.hi, cur.mperf_cur.split.hi); | 306 | h = max_t(u32, cur.aperf.split.hi, cur.mperf.split.hi); |
302 | shift_count = fls(h); | 307 | shift_count = fls(h); |
303 | 308 | ||
304 | cur.aperf_cur.whole >>= shift_count; | 309 | cur.aperf.whole >>= shift_count; |
305 | cur.mperf_cur.whole >>= shift_count; | 310 | cur.mperf.whole >>= shift_count; |
306 | } | 311 | } |
307 | 312 | ||
308 | if (((unsigned long)(-1) / 100) < cur.aperf_cur.split.lo) { | 313 | if (((unsigned long)(-1) / 100) < cur.aperf.split.lo) { |
309 | int shift_count = 7; | 314 | int shift_count = 7; |
310 | cur.aperf_cur.split.lo >>= shift_count; | 315 | cur.aperf.split.lo >>= shift_count; |
311 | cur.mperf_cur.split.lo >>= shift_count; | 316 | cur.mperf.split.lo >>= shift_count; |
312 | } | 317 | } |
313 | 318 | ||
314 | if (cur.aperf_cur.split.lo && cur.mperf_cur.split.lo) | 319 | if (cur.aperf.split.lo && cur.mperf.split.lo) |
315 | perf_percent = (cur.aperf_cur.split.lo * 100) / | 320 | perf_percent = (cur.aperf.split.lo * 100) / cur.mperf.split.lo; |
316 | cur.mperf_cur.split.lo; | ||
317 | else | 321 | else |
318 | perf_percent = 0; | 322 | perf_percent = 0; |
319 | 323 | ||
320 | #else | 324 | #else |
321 | if (unlikely(((unsigned long)(-1) / 100) < cur.aperf_cur.whole)) { | 325 | if (unlikely(((unsigned long)(-1) / 100) < cur.aperf.whole)) { |
322 | int shift_count = 7; | 326 | int shift_count = 7; |
323 | cur.aperf_cur.whole >>= shift_count; | 327 | cur.aperf.whole >>= shift_count; |
324 | cur.mperf_cur.whole >>= shift_count; | 328 | cur.mperf.whole >>= shift_count; |
325 | } | 329 | } |
326 | 330 | ||
327 | if (cur.aperf_cur.whole && cur.mperf_cur.whole) | 331 | if (cur.aperf.whole && cur.mperf.whole) |
328 | perf_percent = (cur.aperf_cur.whole * 100) / | 332 | perf_percent = (cur.aperf.whole * 100) / cur.mperf.whole; |
329 | cur.mperf_cur.whole; | ||
330 | else | 333 | else |
331 | perf_percent = 0; | 334 | perf_percent = 0; |
332 | 335 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c index 0bd48e65a0ca..ce2ed3e4aad9 100644 --- a/arch/x86/kernel/cpu/cpufreq/longhaul.c +++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/timex.h> | 33 | #include <linux/timex.h> |
34 | #include <linux/io.h> | 34 | #include <linux/io.h> |
35 | #include <linux/acpi.h> | 35 | #include <linux/acpi.h> |
36 | #include <linux/kernel.h> | ||
37 | 36 | ||
38 | #include <asm/msr.h> | 37 | #include <asm/msr.h> |
39 | #include <acpi/processor.h> | 38 | #include <acpi/processor.h> |