diff options
Diffstat (limited to 'arch/x86/kernel/io_apic_32.c')
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index c3a565bba10..4ca548632c8 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/htirq.h> | 35 | #include <linux/htirq.h> |
36 | #include <linux/freezer.h> | 36 | #include <linux/freezer.h> |
37 | #include <linux/kthread.h> | 37 | #include <linux/kthread.h> |
38 | #include <linux/jiffies.h> /* time_after() */ | ||
38 | 39 | ||
39 | #include <asm/io.h> | 40 | #include <asm/io.h> |
40 | #include <asm/smp.h> | 41 | #include <asm/smp.h> |
@@ -48,8 +49,6 @@ | |||
48 | #include <mach_apic.h> | 49 | #include <mach_apic.h> |
49 | #include <mach_apicdef.h> | 50 | #include <mach_apicdef.h> |
50 | 51 | ||
51 | #include "io_ports.h" | ||
52 | |||
53 | int (*ioapic_renumber_irq)(int ioapic, int irq); | 52 | int (*ioapic_renumber_irq)(int ioapic, int irq); |
54 | atomic_t irq_mis_count; | 53 | atomic_t irq_mis_count; |
55 | 54 | ||
@@ -351,7 +350,7 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t cpumask) | |||
351 | # include <asm/processor.h> /* kernel_thread() */ | 350 | # include <asm/processor.h> /* kernel_thread() */ |
352 | # include <linux/kernel_stat.h> /* kstat */ | 351 | # include <linux/kernel_stat.h> /* kstat */ |
353 | # include <linux/slab.h> /* kmalloc() */ | 352 | # include <linux/slab.h> /* kmalloc() */ |
354 | # include <linux/timer.h> /* time_after() */ | 353 | # include <linux/timer.h> |
355 | 354 | ||
356 | #define IRQBALANCE_CHECK_ARCH -999 | 355 | #define IRQBALANCE_CHECK_ARCH -999 |
357 | #define MAX_BALANCED_IRQ_INTERVAL (5*HZ) | 356 | #define MAX_BALANCED_IRQ_INTERVAL (5*HZ) |
@@ -727,7 +726,7 @@ late_initcall(balanced_irq_init); | |||
727 | #endif /* CONFIG_SMP */ | 726 | #endif /* CONFIG_SMP */ |
728 | 727 | ||
729 | #ifndef CONFIG_SMP | 728 | #ifndef CONFIG_SMP |
730 | void fastcall send_IPI_self(int vector) | 729 | void send_IPI_self(int vector) |
731 | { | 730 | { |
732 | unsigned int cfg; | 731 | unsigned int cfg; |
733 | 732 | ||
@@ -1900,7 +1899,7 @@ static int __init timer_irq_works(void) | |||
1900 | * might have cached one ExtINT interrupt. Finally, at | 1899 | * might have cached one ExtINT interrupt. Finally, at |
1901 | * least one tick may be lost due to delays. | 1900 | * least one tick may be lost due to delays. |
1902 | */ | 1901 | */ |
1903 | if (jiffies - t1 > 4) | 1902 | if (time_after(jiffies, t1 + 4)) |
1904 | return 1; | 1903 | return 1; |
1905 | 1904 | ||
1906 | return 0; | 1905 | return 0; |
@@ -2080,7 +2079,7 @@ static struct irq_chip lapic_chip __read_mostly = { | |||
2080 | .eoi = ack_apic, | 2079 | .eoi = ack_apic, |
2081 | }; | 2080 | }; |
2082 | 2081 | ||
2083 | static void setup_nmi (void) | 2082 | static void __init setup_nmi(void) |
2084 | { | 2083 | { |
2085 | /* | 2084 | /* |
2086 | * Dirty trick to enable the NMI watchdog ... | 2085 | * Dirty trick to enable the NMI watchdog ... |
@@ -2093,7 +2092,7 @@ static void setup_nmi (void) | |||
2093 | */ | 2092 | */ |
2094 | apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ..."); | 2093 | apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ..."); |
2095 | 2094 | ||
2096 | on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1); | 2095 | enable_NMI_through_LVT0(); |
2097 | 2096 | ||
2098 | apic_printk(APIC_VERBOSE, " done.\n"); | 2097 | apic_printk(APIC_VERBOSE, " done.\n"); |
2099 | } | 2098 | } |
@@ -2169,14 +2168,10 @@ static inline void __init check_timer(void) | |||
2169 | { | 2168 | { |
2170 | int apic1, pin1, apic2, pin2; | 2169 | int apic1, pin1, apic2, pin2; |
2171 | int vector; | 2170 | int vector; |
2172 | unsigned int ver; | ||
2173 | unsigned long flags; | 2171 | unsigned long flags; |
2174 | 2172 | ||
2175 | local_irq_save(flags); | 2173 | local_irq_save(flags); |
2176 | 2174 | ||
2177 | ver = apic_read(APIC_LVR); | ||
2178 | ver = GET_APIC_VERSION(ver); | ||
2179 | |||
2180 | /* | 2175 | /* |
2181 | * get/set the timer IRQ vector: | 2176 | * get/set the timer IRQ vector: |
2182 | */ | 2177 | */ |
@@ -2189,15 +2184,11 @@ static inline void __init check_timer(void) | |||
2189 | * mode for the 8259A whenever interrupts are routed | 2184 | * mode for the 8259A whenever interrupts are routed |
2190 | * through I/O APICs. Also IRQ0 has to be enabled in | 2185 | * through I/O APICs. Also IRQ0 has to be enabled in |
2191 | * the 8259A which implies the virtual wire has to be | 2186 | * the 8259A which implies the virtual wire has to be |
2192 | * disabled in the local APIC. Finally timer interrupts | 2187 | * 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 | */ | 2188 | */ |
2197 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); | 2189 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); |
2198 | init_8259A(1); | 2190 | init_8259A(1); |
2199 | timer_ack = !cpu_has_tsc; | 2191 | timer_ack = 1; |
2200 | timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver)); | ||
2201 | if (timer_over_8254 > 0) | 2192 | if (timer_over_8254 > 0) |
2202 | enable_8259A_irq(0); | 2193 | enable_8259A_irq(0); |
2203 | 2194 | ||
@@ -2409,7 +2400,7 @@ static int ioapic_resume(struct sys_device *dev) | |||
2409 | } | 2400 | } |
2410 | 2401 | ||
2411 | static struct sysdev_class ioapic_sysdev_class = { | 2402 | static struct sysdev_class ioapic_sysdev_class = { |
2412 | set_kset_name("ioapic"), | 2403 | .name = "ioapic", |
2413 | .suspend = ioapic_suspend, | 2404 | .suspend = ioapic_suspend, |
2414 | .resume = ioapic_resume, | 2405 | .resume = ioapic_resume, |
2415 | }; | 2406 | }; |