diff options
author | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
commit | ee3e542fec6e69bc9fb668698889a37d93950ddf (patch) | |
tree | e74ee766a4764769ef1d3d45d266b4dea64101d3 /arch/x86/kernel/acpi | |
parent | fe2a801b50c0bb8039d627e5ae1fec249d10ff39 (diff) | |
parent | f1d6e17f540af37bb1891480143669ba7636c4cf (diff) |
Merge remote-tracking branch 'linus/master' into testing
Diffstat (limited to 'arch/x86/kernel/acpi')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 22 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/sleep.h | 2 |
3 files changed, 30 insertions, 7 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 230c8ea878e5..2627a81253ee 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <asm/mpspec.h> | 44 | #include <asm/mpspec.h> |
45 | #include <asm/smp.h> | 45 | #include <asm/smp.h> |
46 | 46 | ||
47 | #include "sleep.h" /* To include x86_acpi_suspend_lowlevel */ | ||
47 | static int __initdata acpi_force = 0; | 48 | static int __initdata acpi_force = 0; |
48 | u32 acpi_rsdt_forced; | 49 | u32 acpi_rsdt_forced; |
49 | int acpi_disabled; | 50 | int acpi_disabled; |
@@ -194,7 +195,7 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) | |||
194 | return 0; | 195 | return 0; |
195 | } | 196 | } |
196 | 197 | ||
197 | static void __cpuinit acpi_register_lapic(int id, u8 enabled) | 198 | static void acpi_register_lapic(int id, u8 enabled) |
198 | { | 199 | { |
199 | unsigned int ver = 0; | 200 | unsigned int ver = 0; |
200 | 201 | ||
@@ -559,6 +560,12 @@ static int acpi_register_gsi_ioapic(struct device *dev, u32 gsi, | |||
559 | int (*__acpi_register_gsi)(struct device *dev, u32 gsi, | 560 | int (*__acpi_register_gsi)(struct device *dev, u32 gsi, |
560 | int trigger, int polarity) = acpi_register_gsi_pic; | 561 | int trigger, int polarity) = acpi_register_gsi_pic; |
561 | 562 | ||
563 | #ifdef CONFIG_ACPI_SLEEP | ||
564 | int (*acpi_suspend_lowlevel)(void) = x86_acpi_suspend_lowlevel; | ||
565 | #else | ||
566 | int (*acpi_suspend_lowlevel)(void); | ||
567 | #endif | ||
568 | |||
562 | /* | 569 | /* |
563 | * success: return IRQ number (>=0) | 570 | * success: return IRQ number (>=0) |
564 | * failure: return < 0 | 571 | * failure: return < 0 |
@@ -600,7 +607,7 @@ void __init acpi_set_irq_model_ioapic(void) | |||
600 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 607 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
601 | #include <acpi/processor.h> | 608 | #include <acpi/processor.h> |
602 | 609 | ||
603 | static void __cpuinit acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | 610 | static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) |
604 | { | 611 | { |
605 | #ifdef CONFIG_ACPI_NUMA | 612 | #ifdef CONFIG_ACPI_NUMA |
606 | int nid; | 613 | int nid; |
@@ -613,7 +620,7 @@ static void __cpuinit acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | |||
613 | #endif | 620 | #endif |
614 | } | 621 | } |
615 | 622 | ||
616 | static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) | 623 | static int _acpi_map_lsapic(acpi_handle handle, int *pcpu) |
617 | { | 624 | { |
618 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 625 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
619 | union acpi_object *obj; | 626 | union acpi_object *obj; |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index b44577bc9744..33120100ff5e 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -26,12 +26,12 @@ static char temp_stack[4096]; | |||
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * acpi_suspend_lowlevel - save kernel state | 29 | * x86_acpi_suspend_lowlevel - save kernel state |
30 | * | 30 | * |
31 | * Create an identity mapped page table and copy the wakeup routine to | 31 | * Create an identity mapped page table and copy the wakeup routine to |
32 | * low memory. | 32 | * low memory. |
33 | */ | 33 | */ |
34 | int acpi_suspend_lowlevel(void) | 34 | int x86_acpi_suspend_lowlevel(void) |
35 | { | 35 | { |
36 | struct wakeup_header *header = | 36 | struct wakeup_header *header = |
37 | (struct wakeup_header *) __va(real_mode_header->wakeup_header); | 37 | (struct wakeup_header *) __va(real_mode_header->wakeup_header); |
@@ -48,9 +48,20 @@ int acpi_suspend_lowlevel(void) | |||
48 | #ifndef CONFIG_64BIT | 48 | #ifndef CONFIG_64BIT |
49 | native_store_gdt((struct desc_ptr *)&header->pmode_gdt); | 49 | native_store_gdt((struct desc_ptr *)&header->pmode_gdt); |
50 | 50 | ||
51 | /* | ||
52 | * We have to check that we can write back the value, and not | ||
53 | * just read it. At least on 90 nm Pentium M (Family 6, Model | ||
54 | * 13), reading an invalid MSR is not guaranteed to trap, see | ||
55 | * Erratum X4 in "Intel Pentium M Processor on 90 nm Process | ||
56 | * with 2-MB L2 Cache and IntelĀ® Processor A100 and A110 on 90 | ||
57 | * nm process with 512-KB L2 Cache Specification Update". | ||
58 | */ | ||
51 | if (!rdmsr_safe(MSR_EFER, | 59 | if (!rdmsr_safe(MSR_EFER, |
52 | &header->pmode_efer_low, | 60 | &header->pmode_efer_low, |
53 | &header->pmode_efer_high)) | 61 | &header->pmode_efer_high) && |
62 | !wrmsr_safe(MSR_EFER, | ||
63 | header->pmode_efer_low, | ||
64 | header->pmode_efer_high)) | ||
54 | header->pmode_behavior |= (1 << WAKEUP_BEHAVIOR_RESTORE_EFER); | 65 | header->pmode_behavior |= (1 << WAKEUP_BEHAVIOR_RESTORE_EFER); |
55 | #endif /* !CONFIG_64BIT */ | 66 | #endif /* !CONFIG_64BIT */ |
56 | 67 | ||
@@ -61,7 +72,10 @@ int acpi_suspend_lowlevel(void) | |||
61 | } | 72 | } |
62 | if (!rdmsr_safe(MSR_IA32_MISC_ENABLE, | 73 | if (!rdmsr_safe(MSR_IA32_MISC_ENABLE, |
63 | &header->pmode_misc_en_low, | 74 | &header->pmode_misc_en_low, |
64 | &header->pmode_misc_en_high)) | 75 | &header->pmode_misc_en_high) && |
76 | !wrmsr_safe(MSR_IA32_MISC_ENABLE, | ||
77 | header->pmode_misc_en_low, | ||
78 | header->pmode_misc_en_high)) | ||
65 | header->pmode_behavior |= | 79 | header->pmode_behavior |= |
66 | (1 << WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE); | 80 | (1 << WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE); |
67 | header->realmode_flags = acpi_realmode_flags; | 81 | header->realmode_flags = acpi_realmode_flags; |
diff --git a/arch/x86/kernel/acpi/sleep.h b/arch/x86/kernel/acpi/sleep.h index 67f59f8c6956..c9c2c982d5e4 100644 --- a/arch/x86/kernel/acpi/sleep.h +++ b/arch/x86/kernel/acpi/sleep.h | |||
@@ -15,3 +15,5 @@ extern unsigned long acpi_copy_wakeup_routine(unsigned long); | |||
15 | extern void wakeup_long64(void); | 15 | extern void wakeup_long64(void); |
16 | 16 | ||
17 | extern void do_suspend_lowlevel(void); | 17 | extern void do_suspend_lowlevel(void); |
18 | |||
19 | extern int x86_acpi_suspend_lowlevel(void); | ||