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.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 994298bf4921..d341f798255c 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -677,7 +677,7 @@ void __init init_bsp_APIC(void)
677 */ 677 */
678void __cpuinit setup_local_APIC(void) 678void __cpuinit setup_local_APIC(void)
679{ 679{
680 unsigned int value, maxlvt; 680 unsigned int value;
681 int i, j; 681 int i, j;
682 682
683 value = apic_read(APIC_LVR); 683 value = apic_read(APIC_LVR);
@@ -773,32 +773,23 @@ void __cpuinit setup_local_APIC(void)
773 else 773 else
774 value = APIC_DM_NMI | APIC_LVT_MASKED; 774 value = APIC_DM_NMI | APIC_LVT_MASKED;
775 apic_write(APIC_LVT1, value); 775 apic_write(APIC_LVT1, value);
776}
777
778void __cpuinit lapic_setup_esr(void)
779{
780 unsigned maxlvt = lapic_get_maxlvt();
776 781
782 apic_write(APIC_LVTERR, ERROR_APIC_VECTOR);
777 /* 783 /*
778 * Now enable IO-APICs, actually call clear_IO_APIC 784 * spec says clear errors after enabling vector.
779 * We need clear_IO_APIC before enabling vector on BP
780 */ 785 */
781 if (!smp_processor_id() && !skip_ioapic_setup && nr_ioapics) 786 if (maxlvt > 3)
782 enable_IO_APIC(); 787 apic_write(APIC_ESR, 0);
783 788}
784 {
785 unsigned oldvalue;
786 maxlvt = lapic_get_maxlvt();
787 oldvalue = apic_read(APIC_ESR);
788 value = ERROR_APIC_VECTOR; // enables sending errors
789 apic_write(APIC_LVTERR, value);
790 /*
791 * spec says clear errors after enabling vector.
792 */
793 if (maxlvt > 3)
794 apic_write(APIC_ESR, 0);
795 value = apic_read(APIC_ESR);
796 if (value != oldvalue)
797 apic_printk(APIC_VERBOSE,
798 "ESR value after enabling vector: %08x, after %08x\n",
799 oldvalue, value);
800 }
801 789
790void __cpuinit end_local_APIC_setup(void)
791{
792 lapic_setup_esr();
802 nmi_watchdog_default(); 793 nmi_watchdog_default();
803 setup_apic_nmi_watchdog(NULL); 794 setup_apic_nmi_watchdog(NULL);
804 apic_pm_activate(); 795 apic_pm_activate();
@@ -879,6 +870,15 @@ int __init APIC_init_uniprocessor(void)
879 870
880 setup_local_APIC(); 871 setup_local_APIC();
881 872
873 /*
874 * Now enable IO-APICs, actually call clear_IO_APIC
875 * We need clear_IO_APIC before enabling vector on BP
876 */
877 if (!skip_ioapic_setup && nr_ioapics)
878 enable_IO_APIC();
879
880 end_local_APIC_setup();
881
882 if (smp_found_config && !skip_ioapic_setup && nr_ioapics) 882 if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
883 setup_IO_APIC(); 883 setup_IO_APIC();
884 else 884 else