aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/apic.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-05-20 14:06:24 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-05-20 14:08:05 -0400
commit250f972d85effad5b6e10da4bbd877e6a4b503b6 (patch)
tree007393a6fc6439af7e0121dd99a6f9f9fb8405bc /arch/x86/kernel/apic/apic.c
parent7372b0b122af0f6675f3ab65bfd91c8a438e0480 (diff)
parentbbe7b8bef48c567f5ff3f6041c1fb011292e8f12 (diff)
Merge branch 'timers/urgent' into timers/core
Reason: Get upstream fixes and kfree_rcu which is necessary for a follow up patch. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r--arch/x86/kernel/apic/apic.c69
1 files changed, 38 insertions, 31 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index fabf01eff771..f92a8e5d1e21 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -505,7 +505,7 @@ static void __cpuinit setup_APIC_timer(void)
505{ 505{
506 struct clock_event_device *levt = &__get_cpu_var(lapic_events); 506 struct clock_event_device *levt = &__get_cpu_var(lapic_events);
507 507
508 if (cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_ARAT)) { 508 if (this_cpu_has(X86_FEATURE_ARAT)) {
509 lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP; 509 lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP;
510 /* Make LAPIC timer preferrable over percpu HPET */ 510 /* Make LAPIC timer preferrable over percpu HPET */
511 lapic_clockevent.rating = 150; 511 lapic_clockevent.rating = 150;
@@ -1237,6 +1237,17 @@ void __cpuinit setup_local_APIC(void)
1237 /* always use the value from LDR */ 1237 /* always use the value from LDR */
1238 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = 1238 early_per_cpu(x86_cpu_to_logical_apicid, cpu) =
1239 logical_smp_processor_id(); 1239 logical_smp_processor_id();
1240
1241 /*
1242 * Some NUMA implementations (NUMAQ) don't initialize apicid to
1243 * node mapping during NUMA init. Now that logical apicid is
1244 * guaranteed to be known, give it another chance. This is already
1245 * a bit too late - percpu allocation has already happened without
1246 * proper NUMA affinity.
1247 */
1248 if (apic->x86_32_numa_cpu_node)
1249 set_apicid_to_node(early_per_cpu(x86_cpu_to_apicid, cpu),
1250 apic->x86_32_numa_cpu_node(cpu));
1240#endif 1251#endif
1241 1252
1242 /* 1253 /*
@@ -1812,30 +1823,41 @@ void smp_spurious_interrupt(struct pt_regs *regs)
1812 */ 1823 */
1813void smp_error_interrupt(struct pt_regs *regs) 1824void smp_error_interrupt(struct pt_regs *regs)
1814{ 1825{
1815 u32 v, v1; 1826 u32 v0, v1;
1827 u32 i = 0;
1828 static const char * const error_interrupt_reason[] = {
1829 "Send CS error", /* APIC Error Bit 0 */
1830 "Receive CS error", /* APIC Error Bit 1 */
1831 "Send accept error", /* APIC Error Bit 2 */
1832 "Receive accept error", /* APIC Error Bit 3 */
1833 "Redirectable IPI", /* APIC Error Bit 4 */
1834 "Send illegal vector", /* APIC Error Bit 5 */
1835 "Received illegal vector", /* APIC Error Bit 6 */
1836 "Illegal register address", /* APIC Error Bit 7 */
1837 };
1816 1838
1817 exit_idle(); 1839 exit_idle();
1818 irq_enter(); 1840 irq_enter();
1819 /* First tickle the hardware, only then report what went on. -- REW */ 1841 /* First tickle the hardware, only then report what went on. -- REW */
1820 v = apic_read(APIC_ESR); 1842 v0 = apic_read(APIC_ESR);
1821 apic_write(APIC_ESR, 0); 1843 apic_write(APIC_ESR, 0);
1822 v1 = apic_read(APIC_ESR); 1844 v1 = apic_read(APIC_ESR);
1823 ack_APIC_irq(); 1845 ack_APIC_irq();
1824 atomic_inc(&irq_err_count); 1846 atomic_inc(&irq_err_count);
1825 1847
1826 /* 1848 apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x(%02x)",
1827 * Here is what the APIC error bits mean: 1849 smp_processor_id(), v0 , v1);
1828 * 0: Send CS error 1850
1829 * 1: Receive CS error 1851 v1 = v1 & 0xff;
1830 * 2: Send accept error 1852 while (v1) {
1831 * 3: Receive accept error 1853 if (v1 & 0x1)
1832 * 4: Reserved 1854 apic_printk(APIC_DEBUG, KERN_CONT " : %s", error_interrupt_reason[i]);
1833 * 5: Send illegal vector 1855 i++;
1834 * 6: Received illegal vector 1856 v1 >>= 1;
1835 * 7: Illegal register address 1857 };
1836 */ 1858
1837 pr_debug("APIC error on CPU%d: %02x(%02x)\n", 1859 apic_printk(APIC_DEBUG, KERN_CONT "\n");
1838 smp_processor_id(), v , v1); 1860
1839 irq_exit(); 1861 irq_exit();
1840} 1862}
1841 1863
@@ -2003,21 +2025,6 @@ void default_init_apic_ldr(void)
2003 apic_write(APIC_LDR, val); 2025 apic_write(APIC_LDR, val);
2004} 2026}
2005 2027
2006#ifdef CONFIG_X86_32
2007int default_x86_32_numa_cpu_node(int cpu)
2008{
2009#ifdef CONFIG_NUMA
2010 int apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
2011
2012 if (apicid != BAD_APICID)
2013 return __apicid_to_node[apicid];
2014 return NUMA_NO_NODE;
2015#else
2016 return 0;
2017#endif
2018}
2019#endif
2020
2021/* 2028/*
2022 * Power management 2029 * Power management
2023 */ 2030 */