aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/apic_64.c')
-rw-r--r--arch/x86/kernel/apic_64.c38
1 files changed, 8 insertions, 30 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 5910020c3f24..3ef7752aa8e5 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -43,7 +43,7 @@
43#include <mach_ipi.h> 43#include <mach_ipi.h>
44#include <mach_apic.h> 44#include <mach_apic.h>
45 45
46int disable_apic_timer __cpuinitdata; 46static int disable_apic_timer __cpuinitdata;
47static int apic_calibrate_pmtmr __initdata; 47static int apic_calibrate_pmtmr __initdata;
48int disable_apic; 48int disable_apic;
49 49
@@ -422,32 +422,8 @@ void __init setup_boot_APIC_clock(void)
422 setup_APIC_timer(); 422 setup_APIC_timer();
423} 423}
424 424
425/*
426 * AMD C1E enabled CPUs have a real nasty problem: Some BIOSes set the
427 * C1E flag only in the secondary CPU, so when we detect the wreckage
428 * we already have enabled the boot CPU local apic timer. Check, if
429 * disable_apic_timer is set and the DUMMY flag is cleared. If yes,
430 * set the DUMMY flag again and force the broadcast mode in the
431 * clockevents layer.
432 */
433static void __cpuinit check_boot_apic_timer_broadcast(void)
434{
435 if (!disable_apic_timer ||
436 (lapic_clockevent.features & CLOCK_EVT_FEAT_DUMMY))
437 return;
438
439 printk(KERN_INFO "AMD C1E detected late. Force timer broadcast.\n");
440 lapic_clockevent.features |= CLOCK_EVT_FEAT_DUMMY;
441
442 local_irq_enable();
443 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
444 &boot_cpu_physical_apicid);
445 local_irq_disable();
446}
447
448void __cpuinit setup_secondary_APIC_clock(void) 425void __cpuinit setup_secondary_APIC_clock(void)
449{ 426{
450 check_boot_apic_timer_broadcast();
451 setup_APIC_timer(); 427 setup_APIC_timer();
452} 428}
453 429
@@ -534,7 +510,7 @@ int setup_profiling_timer(unsigned int multiplier)
534 */ 510 */
535void clear_local_APIC(void) 511void clear_local_APIC(void)
536{ 512{
537 int maxlvt = lapic_get_maxlvt(); 513 int maxlvt;
538 u32 v; 514 u32 v;
539 515
540 /* APIC hasn't been mapped yet */ 516 /* APIC hasn't been mapped yet */
@@ -875,7 +851,7 @@ static int __init detect_init_APIC(void)
875 851
876void __init early_init_lapic_mapping(void) 852void __init early_init_lapic_mapping(void)
877{ 853{
878 unsigned long apic_phys; 854 unsigned long phys_addr;
879 855
880 /* 856 /*
881 * If no local APIC can be found then go out 857 * If no local APIC can be found then go out
@@ -884,11 +860,11 @@ void __init early_init_lapic_mapping(void)
884 if (!smp_found_config) 860 if (!smp_found_config)
885 return; 861 return;
886 862
887 apic_phys = mp_lapic_addr; 863 phys_addr = mp_lapic_addr;
888 864
889 set_fixmap_nocache(FIX_APIC_BASE, apic_phys); 865 set_fixmap_nocache(FIX_APIC_BASE, phys_addr);
890 apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n", 866 apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",
891 APIC_BASE, apic_phys); 867 APIC_BASE, phys_addr);
892 868
893 /* 869 /*
894 * Fetch the APIC ID of the BSP in case we have a 870 * Fetch the APIC ID of the BSP in case we have a
@@ -954,6 +930,8 @@ int __init APIC_init_uniprocessor(void)
954 if (!skip_ioapic_setup && nr_ioapics) 930 if (!skip_ioapic_setup && nr_ioapics)
955 enable_IO_APIC(); 931 enable_IO_APIC();
956 932
933 if (!smp_found_config || skip_ioapic_setup || !nr_ioapics)
934 localise_nmi_watchdog();
957 end_local_APIC_setup(); 935 end_local_APIC_setup();
958 936
959 if (smp_found_config && !skip_ioapic_setup && nr_ioapics) 937 if (smp_found_config && !skip_ioapic_setup && nr_ioapics)