aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/apm_32.c10
-rw-r--r--arch/x86/kernel/head_32.S2
-rw-r--r--arch/x86/kernel/hpet.c2
-rw-r--r--arch/x86/kernel/io_apic_32.c12
-rw-r--r--arch/x86/kernel/mfgpt_32.c15
-rw-r--r--arch/x86/kernel/nmi_32.c9
-rw-r--r--arch/x86/kernel/process_32.c11
-rw-r--r--arch/x86/kernel/process_64.c11
-rw-r--r--arch/x86/kernel/smpboot_64.c4
-rw-r--r--arch/x86/kernel/traps_32.c1
-rw-r--r--arch/x86/kernel/traps_64.c1
11 files changed, 43 insertions, 35 deletions
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 17089a041028..af045ca0f653 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -2256,14 +2256,12 @@ static int __init apm_init(void)
2256 apm_info.disabled = 1; 2256 apm_info.disabled = 1;
2257 return -ENODEV; 2257 return -ENODEV;
2258 } 2258 }
2259 if (PM_IS_ACTIVE()) { 2259 if (pm_flags & PM_ACPI) {
2260 printk(KERN_NOTICE "apm: overridden by ACPI.\n"); 2260 printk(KERN_NOTICE "apm: overridden by ACPI.\n");
2261 apm_info.disabled = 1; 2261 apm_info.disabled = 1;
2262 return -ENODEV; 2262 return -ENODEV;
2263 } 2263 }
2264#ifdef CONFIG_PM_LEGACY 2264 pm_flags |= PM_APM;
2265 pm_active = 1;
2266#endif
2267 2265
2268 /* 2266 /*
2269 * Set up a segment that references the real mode segment 0x40 2267 * Set up a segment that references the real mode segment 0x40
@@ -2366,9 +2364,7 @@ static void __exit apm_exit(void)
2366 kthread_stop(kapmd_task); 2364 kthread_stop(kapmd_task);
2367 kapmd_task = NULL; 2365 kapmd_task = NULL;
2368 } 2366 }
2369#ifdef CONFIG_PM_LEGACY 2367 pm_flags &= ~PM_APM;
2370 pm_active = 0;
2371#endif
2372} 2368}
2373 2369
2374module_init(apm_init); 2370module_init(apm_init);
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index ac0637a6d71c..fbad51fce672 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -196,7 +196,7 @@ default_entry:
196 /* Do an early initialization of the fixmap area */ 196 /* Do an early initialization of the fixmap area */
197 movl $(swapper_pg_dir - __PAGE_OFFSET), %edx 197 movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
198 movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax 198 movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax
199 addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ 199 addl $0x67, %eax /* 0x67 == _PAGE_TABLE */
200 movl %eax, 4092(%edx) 200 movl %eax, 4092(%edx)
201 201
202 xorl %ebx,%ebx /* This is the boot CPU (BSP) */ 202 xorl %ebx,%ebx /* This is the boot CPU (BSP) */
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 4a86ffd67ec5..2f99ee206b95 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -657,7 +657,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
657 hpet_pie_count = 0; 657 hpet_pie_count = 0;
658 } 658 }
659 659
660 if (hpet_rtc_flags & RTC_PIE && 660 if (hpet_rtc_flags & RTC_AIE &&
661 (curr_time.tm_sec == hpet_alarm_time.tm_sec) && 661 (curr_time.tm_sec == hpet_alarm_time.tm_sec) &&
662 (curr_time.tm_min == hpet_alarm_time.tm_min) && 662 (curr_time.tm_min == hpet_alarm_time.tm_min) &&
663 (curr_time.tm_hour == hpet_alarm_time.tm_hour)) 663 (curr_time.tm_hour == hpet_alarm_time.tm_hour))
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index c3a565bba106..a6b1490e00c4 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -2169,14 +2169,10 @@ static inline void __init check_timer(void)
2169{ 2169{
2170 int apic1, pin1, apic2, pin2; 2170 int apic1, pin1, apic2, pin2;
2171 int vector; 2171 int vector;
2172 unsigned int ver;
2173 unsigned long flags; 2172 unsigned long flags;
2174 2173
2175 local_irq_save(flags); 2174 local_irq_save(flags);
2176 2175
2177 ver = apic_read(APIC_LVR);
2178 ver = GET_APIC_VERSION(ver);
2179
2180 /* 2176 /*
2181 * get/set the timer IRQ vector: 2177 * get/set the timer IRQ vector:
2182 */ 2178 */
@@ -2189,15 +2185,11 @@ static inline void __init check_timer(void)
2189 * mode for the 8259A whenever interrupts are routed 2185 * mode for the 8259A whenever interrupts are routed
2190 * through I/O APICs. Also IRQ0 has to be enabled in 2186 * through I/O APICs. Also IRQ0 has to be enabled in
2191 * the 8259A which implies the virtual wire has to be 2187 * the 8259A which implies the virtual wire has to be
2192 * disabled in the local APIC. Finally timer interrupts 2188 * disabled in the local APIC.
2193 * need to be acknowledged manually in the 8259A for
2194 * timer_interrupt() and for the i82489DX when using
2195 * the NMI watchdog.
2196 */ 2189 */
2197 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2190 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
2198 init_8259A(1); 2191 init_8259A(1);
2199 timer_ack = !cpu_has_tsc; 2192 timer_ack = 1;
2200 timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
2201 if (timer_over_8254 > 0) 2193 if (timer_over_8254 > 0)
2202 enable_8259A_irq(0); 2194 enable_8259A_irq(0);
2203 2195
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 0ab680f2d9db..3960ab7e1497 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -278,12 +278,12 @@ static int mfgpt_next_event(unsigned long delta, struct clock_event_device *evt)
278 278
279static irqreturn_t mfgpt_tick(int irq, void *dev_id) 279static irqreturn_t mfgpt_tick(int irq, void *dev_id)
280{ 280{
281 /* Turn off the clock (and clear the event) */
282 mfgpt_disable_timer(mfgpt_event_clock);
283
281 if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN) 284 if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN)
282 return IRQ_HANDLED; 285 return IRQ_HANDLED;
283 286
284 /* Turn off the clock */
285 mfgpt_disable_timer(mfgpt_event_clock);
286
287 /* Clear the counter */ 287 /* Clear the counter */
288 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0); 288 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
289 289
@@ -319,10 +319,6 @@ static int __init mfgpt_timer_setup(void)
319 } 319 }
320 320
321 mfgpt_event_clock = timer; 321 mfgpt_event_clock = timer;
322 /* Set the clock scale and enable the event mode for CMP2 */
323 val = MFGPT_SCALE | (3 << 8);
324
325 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
326 322
327 /* Set up the IRQ on the MFGPT side */ 323 /* Set up the IRQ on the MFGPT side */
328 if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) { 324 if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) {
@@ -339,6 +335,11 @@ static int __init mfgpt_timer_setup(void)
339 goto err; 335 goto err;
340 } 336 }
341 337
338 /* Set the clock scale and enable the event mode for CMP2 */
339 val = MFGPT_SCALE | (3 << 8);
340
341 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
342
342 /* Set up the clock event */ 343 /* Set up the clock event */
343 mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32); 344 mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32);
344 mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF, 345 mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF,
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index 80ca72e5ac29..852db2906921 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -25,7 +25,6 @@
25 25
26#include <asm/smp.h> 26#include <asm/smp.h>
27#include <asm/nmi.h> 27#include <asm/nmi.h>
28#include <asm/timer.h>
29 28
30#include "mach_traps.h" 29#include "mach_traps.h"
31 30
@@ -84,7 +83,7 @@ static int __init check_nmi_watchdog(void)
84 83
85 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL); 84 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
86 if (!prev_nmi_count) 85 if (!prev_nmi_count)
87 goto error; 86 return -1;
88 87
89 printk(KERN_INFO "Testing NMI watchdog ... "); 88 printk(KERN_INFO "Testing NMI watchdog ... ");
90 89
@@ -119,7 +118,7 @@ static int __init check_nmi_watchdog(void)
119 if (!atomic_read(&nmi_active)) { 118 if (!atomic_read(&nmi_active)) {
120 kfree(prev_nmi_count); 119 kfree(prev_nmi_count);
121 atomic_set(&nmi_active, -1); 120 atomic_set(&nmi_active, -1);
122 goto error; 121 return -1;
123 } 122 }
124 printk("OK.\n"); 123 printk("OK.\n");
125 124
@@ -130,10 +129,6 @@ static int __init check_nmi_watchdog(void)
130 129
131 kfree(prev_nmi_count); 130 kfree(prev_nmi_count);
132 return 0; 131 return 0;
133error:
134 timer_ack = !cpu_has_tsc;
135
136 return -1;
137} 132}
138/* This needs to happen later in boot so counters are working */ 133/* This needs to happen later in boot so counters are working */
139late_initcall(check_nmi_watchdog); 134late_initcall(check_nmi_watchdog);
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 9663c2a74830..46d391d49de8 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -204,6 +204,10 @@ void cpu_idle(void)
204 } 204 }
205} 205}
206 206
207static void do_nothing(void *unused)
208{
209}
210
207void cpu_idle_wait(void) 211void cpu_idle_wait(void)
208{ 212{
209 unsigned int cpu, this_cpu = get_cpu(); 213 unsigned int cpu, this_cpu = get_cpu();
@@ -228,6 +232,13 @@ void cpu_idle_wait(void)
228 cpu_clear(cpu, map); 232 cpu_clear(cpu, map);
229 } 233 }
230 cpus_and(map, map, cpu_online_map); 234 cpus_and(map, map, cpu_online_map);
235 /*
236 * We waited 1 sec, if a CPU still did not call idle
237 * it may be because it is in idle and not waking up
238 * because it has nothing to do.
239 * Give all the remaining CPUS a kick.
240 */
241 smp_call_function_mask(map, do_nothing, 0, 0);
231 } while (!cpus_empty(map)); 242 } while (!cpus_empty(map));
232 243
233 set_cpus_allowed(current, tmp); 244 set_cpus_allowed(current, tmp);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 6309b275cb9c..ab79e1dfa023 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -135,6 +135,10 @@ static void poll_idle (void)
135 cpu_relax(); 135 cpu_relax();
136} 136}
137 137
138static void do_nothing(void *unused)
139{
140}
141
138void cpu_idle_wait(void) 142void cpu_idle_wait(void)
139{ 143{
140 unsigned int cpu, this_cpu = get_cpu(); 144 unsigned int cpu, this_cpu = get_cpu();
@@ -160,6 +164,13 @@ void cpu_idle_wait(void)
160 cpu_clear(cpu, map); 164 cpu_clear(cpu, map);
161 } 165 }
162 cpus_and(map, map, cpu_online_map); 166 cpus_and(map, map, cpu_online_map);
167 /*
168 * We waited 1 sec, if a CPU still did not call idle
169 * it may be because it is in idle and not waking up
170 * because it has nothing to do.
171 * Give all the remaining CPUS a kick.
172 */
173 smp_call_function_mask(map, do_nothing, 0, 0);
163 } while (!cpus_empty(map)); 174 } while (!cpus_empty(map));
164 175
165 set_cpus_allowed(current, tmp); 176 set_cpus_allowed(current, tmp);
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 594889521da1..aaf4e1291217 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -141,8 +141,8 @@ static void __cpuinit smp_store_cpu_info(int id)
141 struct cpuinfo_x86 *c = &cpu_data(id); 141 struct cpuinfo_x86 *c = &cpu_data(id);
142 142
143 *c = boot_cpu_data; 143 *c = boot_cpu_data;
144 identify_cpu(c);
145 c->cpu_index = id; 144 c->cpu_index = id;
145 identify_cpu(c);
146 print_cpu_info(c); 146 print_cpu_info(c);
147} 147}
148 148
@@ -526,7 +526,7 @@ struct create_idle {
526 int cpu; 526 int cpu;
527}; 527};
528 528
529void do_fork_idle(struct work_struct *work) 529static void __cpuinit do_fork_idle(struct work_struct *work)
530{ 530{
531 struct create_idle *c_idle = 531 struct create_idle *c_idle =
532 container_of(work, struct create_idle, work); 532 container_of(work, struct create_idle, work);
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index c88bbffcaa03..02d1e1e58e81 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -541,6 +541,7 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \
541 info.si_errno = 0; \ 541 info.si_errno = 0; \
542 info.si_code = sicode; \ 542 info.si_code = sicode; \
543 info.si_addr = (void __user *)siaddr; \ 543 info.si_addr = (void __user *)siaddr; \
544 trace_hardirqs_fixup(); \
544 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 545 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
545 == NOTIFY_STOP) \ 546 == NOTIFY_STOP) \
546 return; \ 547 return; \
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index d11525ad81b4..cc68b92316cd 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -635,6 +635,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
635 info.si_errno = 0; \ 635 info.si_errno = 0; \
636 info.si_code = sicode; \ 636 info.si_code = sicode; \
637 info.si_addr = (void __user *)siaddr; \ 637 info.si_addr = (void __user *)siaddr; \
638 trace_hardirqs_fixup(); \
638 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 639 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
639 == NOTIFY_STOP) \ 640 == NOTIFY_STOP) \
640 return; \ 641 return; \