diff options
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 3c8f9e75d038..809e1cf86d6b 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -96,6 +96,11 @@ struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES]; | |||
96 | /* # of MP IRQ source entries */ | 96 | /* # of MP IRQ source entries */ |
97 | int mp_irq_entries; | 97 | int mp_irq_entries; |
98 | 98 | ||
99 | /* Number of legacy interrupts */ | ||
100 | static int nr_legacy_irqs __read_mostly = NR_IRQS_LEGACY; | ||
101 | /* GSI interrupts */ | ||
102 | static int nr_irqs_gsi = NR_IRQS_LEGACY; | ||
103 | |||
99 | #if defined (CONFIG_MCA) || defined (CONFIG_EISA) | 104 | #if defined (CONFIG_MCA) || defined (CONFIG_EISA) |
100 | int mp_bus_id_to_type[MAX_MP_BUSSES]; | 105 | int mp_bus_id_to_type[MAX_MP_BUSSES]; |
101 | #endif | 106 | #endif |
@@ -173,6 +178,12 @@ static struct irq_cfg irq_cfgx[NR_IRQS] = { | |||
173 | [15] = { .vector = IRQ15_VECTOR, }, | 178 | [15] = { .vector = IRQ15_VECTOR, }, |
174 | }; | 179 | }; |
175 | 180 | ||
181 | void __init io_apic_disable_legacy(void) | ||
182 | { | ||
183 | nr_legacy_irqs = 0; | ||
184 | nr_irqs_gsi = 0; | ||
185 | } | ||
186 | |||
176 | int __init arch_early_irq_init(void) | 187 | int __init arch_early_irq_init(void) |
177 | { | 188 | { |
178 | struct irq_cfg *cfg; | 189 | struct irq_cfg *cfg; |
@@ -190,7 +201,7 @@ int __init arch_early_irq_init(void) | |||
190 | desc->chip_data = &cfg[i]; | 201 | desc->chip_data = &cfg[i]; |
191 | zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node); | 202 | zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node); |
192 | zalloc_cpumask_var_node(&cfg[i].old_domain, GFP_NOWAIT, node); | 203 | zalloc_cpumask_var_node(&cfg[i].old_domain, GFP_NOWAIT, node); |
193 | if (i < NR_IRQS_LEGACY) | 204 | if (i < nr_legacy_irqs) |
194 | cpumask_setall(cfg[i].domain); | 205 | cpumask_setall(cfg[i].domain); |
195 | } | 206 | } |
196 | 207 | ||
@@ -867,7 +878,7 @@ static int __init find_isa_irq_apic(int irq, int type) | |||
867 | */ | 878 | */ |
868 | static int EISA_ELCR(unsigned int irq) | 879 | static int EISA_ELCR(unsigned int irq) |
869 | { | 880 | { |
870 | if (irq < NR_IRQS_LEGACY) { | 881 | if (irq < nr_legacy_irqs) { |
871 | unsigned int port = 0x4d0 + (irq >> 3); | 882 | unsigned int port = 0x4d0 + (irq >> 3); |
872 | return (inb(port) >> (irq & 7)) & 1; | 883 | return (inb(port) >> (irq & 7)) & 1; |
873 | } | 884 | } |
@@ -1464,7 +1475,7 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq | |||
1464 | } | 1475 | } |
1465 | 1476 | ||
1466 | ioapic_register_intr(irq, desc, trigger); | 1477 | ioapic_register_intr(irq, desc, trigger); |
1467 | if (irq < NR_IRQS_LEGACY) | 1478 | if (irq < nr_legacy_irqs) |
1468 | disable_8259A_irq(irq); | 1479 | disable_8259A_irq(irq); |
1469 | 1480 | ||
1470 | ioapic_write_entry(apic_id, pin, entry); | 1481 | ioapic_write_entry(apic_id, pin, entry); |
@@ -1831,7 +1842,7 @@ __apicdebuginit(void) print_PIC(void) | |||
1831 | unsigned int v; | 1842 | unsigned int v; |
1832 | unsigned long flags; | 1843 | unsigned long flags; |
1833 | 1844 | ||
1834 | if (apic_verbosity == APIC_QUIET) | 1845 | if (apic_verbosity == APIC_QUIET || !nr_legacy_irqs) |
1835 | return; | 1846 | return; |
1836 | 1847 | ||
1837 | printk(KERN_DEBUG "\nprinting PIC contents\n"); | 1848 | printk(KERN_DEBUG "\nprinting PIC contents\n"); |
@@ -1894,6 +1905,10 @@ void __init enable_IO_APIC(void) | |||
1894 | spin_unlock_irqrestore(&ioapic_lock, flags); | 1905 | spin_unlock_irqrestore(&ioapic_lock, flags); |
1895 | nr_ioapic_registers[apic] = reg_01.bits.entries+1; | 1906 | nr_ioapic_registers[apic] = reg_01.bits.entries+1; |
1896 | } | 1907 | } |
1908 | |||
1909 | if (!nr_legacy_irqs) | ||
1910 | return; | ||
1911 | |||
1897 | for(apic = 0; apic < nr_ioapics; apic++) { | 1912 | for(apic = 0; apic < nr_ioapics; apic++) { |
1898 | int pin; | 1913 | int pin; |
1899 | /* See if any of the pins is in ExtINT mode */ | 1914 | /* See if any of the pins is in ExtINT mode */ |
@@ -1948,6 +1963,9 @@ void disable_IO_APIC(void) | |||
1948 | */ | 1963 | */ |
1949 | clear_IO_APIC(); | 1964 | clear_IO_APIC(); |
1950 | 1965 | ||
1966 | if (!nr_legacy_irqs) | ||
1967 | return; | ||
1968 | |||
1951 | /* | 1969 | /* |
1952 | * If the i8259 is routed through an IOAPIC | 1970 | * If the i8259 is routed through an IOAPIC |
1953 | * Put that IOAPIC in virtual wire mode | 1971 | * Put that IOAPIC in virtual wire mode |
@@ -1994,7 +2012,7 @@ void disable_IO_APIC(void) | |||
1994 | * by Matt Domsch <Matt_Domsch@dell.com> Tue Dec 21 12:25:05 CST 1999 | 2012 | * by Matt Domsch <Matt_Domsch@dell.com> Tue Dec 21 12:25:05 CST 1999 |
1995 | */ | 2013 | */ |
1996 | 2014 | ||
1997 | static void __init setup_ioapic_ids_from_mpc(void) | 2015 | void __init setup_ioapic_ids_from_mpc(void) |
1998 | { | 2016 | { |
1999 | union IO_APIC_reg_00 reg_00; | 2017 | union IO_APIC_reg_00 reg_00; |
2000 | physid_mask_t phys_id_present_map; | 2018 | physid_mask_t phys_id_present_map; |
@@ -2003,9 +2021,8 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
2003 | unsigned char old_id; | 2021 | unsigned char old_id; |
2004 | unsigned long flags; | 2022 | unsigned long flags; |
2005 | 2023 | ||
2006 | if (x86_quirks->setup_ioapic_ids && x86_quirks->setup_ioapic_ids()) | 2024 | if (acpi_ioapic) |
2007 | return; | 2025 | return; |
2008 | |||
2009 | /* | 2026 | /* |
2010 | * Don't check I/O APIC IDs for xAPIC systems. They have | 2027 | * Don't check I/O APIC IDs for xAPIC systems. They have |
2011 | * no meaning without the serial APIC bus. | 2028 | * no meaning without the serial APIC bus. |
@@ -2179,7 +2196,7 @@ static unsigned int startup_ioapic_irq(unsigned int irq) | |||
2179 | struct irq_cfg *cfg; | 2196 | struct irq_cfg *cfg; |
2180 | 2197 | ||
2181 | spin_lock_irqsave(&ioapic_lock, flags); | 2198 | spin_lock_irqsave(&ioapic_lock, flags); |
2182 | if (irq < NR_IRQS_LEGACY) { | 2199 | if (irq < nr_legacy_irqs) { |
2183 | disable_8259A_irq(irq); | 2200 | disable_8259A_irq(irq); |
2184 | if (i8259A_irq_pending(irq)) | 2201 | if (i8259A_irq_pending(irq)) |
2185 | was_pending = 1; | 2202 | was_pending = 1; |
@@ -2657,7 +2674,7 @@ static inline void init_IO_APIC_traps(void) | |||
2657 | * so default to an old-fashioned 8259 | 2674 | * so default to an old-fashioned 8259 |
2658 | * interrupt if we can.. | 2675 | * interrupt if we can.. |
2659 | */ | 2676 | */ |
2660 | if (irq < NR_IRQS_LEGACY) | 2677 | if (irq < nr_legacy_irqs) |
2661 | make_8259A_irq(irq); | 2678 | make_8259A_irq(irq); |
2662 | else | 2679 | else |
2663 | /* Strange. Oh, well.. */ | 2680 | /* Strange. Oh, well.. */ |
@@ -2993,7 +3010,7 @@ out: | |||
2993 | * the I/O APIC in all cases now. No actual device should request | 3010 | * the I/O APIC in all cases now. No actual device should request |
2994 | * it anyway. --macro | 3011 | * it anyway. --macro |
2995 | */ | 3012 | */ |
2996 | #define PIC_IRQS (1 << PIC_CASCADE_IR) | 3013 | #define PIC_IRQS (1UL << PIC_CASCADE_IR) |
2997 | 3014 | ||
2998 | void __init setup_IO_APIC(void) | 3015 | void __init setup_IO_APIC(void) |
2999 | { | 3016 | { |
@@ -3001,21 +3018,19 @@ void __init setup_IO_APIC(void) | |||
3001 | /* | 3018 | /* |
3002 | * calling enable_IO_APIC() is moved to setup_local_APIC for BP | 3019 | * calling enable_IO_APIC() is moved to setup_local_APIC for BP |
3003 | */ | 3020 | */ |
3004 | 3021 | io_apic_irqs = nr_legacy_irqs ? ~PIC_IRQS : ~0UL; | |
3005 | io_apic_irqs = ~PIC_IRQS; | ||
3006 | 3022 | ||
3007 | apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n"); | 3023 | apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n"); |
3008 | /* | 3024 | /* |
3009 | * Set up IO-APIC IRQ routing. | 3025 | * Set up IO-APIC IRQ routing. |
3010 | */ | 3026 | */ |
3011 | #ifdef CONFIG_X86_32 | 3027 | x86_init.mpparse.setup_ioapic_ids(); |
3012 | if (!acpi_ioapic) | 3028 | |
3013 | setup_ioapic_ids_from_mpc(); | ||
3014 | #endif | ||
3015 | sync_Arb_IDs(); | 3029 | sync_Arb_IDs(); |
3016 | setup_IO_APIC_irqs(); | 3030 | setup_IO_APIC_irqs(); |
3017 | init_IO_APIC_traps(); | 3031 | init_IO_APIC_traps(); |
3018 | check_timer(); | 3032 | if (nr_legacy_irqs) |
3033 | check_timer(); | ||
3019 | } | 3034 | } |
3020 | 3035 | ||
3021 | /* | 3036 | /* |
@@ -3116,7 +3131,6 @@ static int __init ioapic_init_sysfs(void) | |||
3116 | 3131 | ||
3117 | device_initcall(ioapic_init_sysfs); | 3132 | device_initcall(ioapic_init_sysfs); |
3118 | 3133 | ||
3119 | static int nr_irqs_gsi = NR_IRQS_LEGACY; | ||
3120 | /* | 3134 | /* |
3121 | * Dynamic irq allocate and deallocation | 3135 | * Dynamic irq allocate and deallocation |
3122 | */ | 3136 | */ |
@@ -3856,7 +3870,7 @@ static int __io_apic_set_pci_routing(struct device *dev, int irq, | |||
3856 | /* | 3870 | /* |
3857 | * IRQs < 16 are already in the irq_2_pin[] map | 3871 | * IRQs < 16 are already in the irq_2_pin[] map |
3858 | */ | 3872 | */ |
3859 | if (irq >= NR_IRQS_LEGACY) { | 3873 | if (irq >= nr_legacy_irqs) { |
3860 | cfg = desc->chip_data; | 3874 | cfg = desc->chip_data; |
3861 | if (add_pin_to_irq_node_nopanic(cfg, node, ioapic, pin)) { | 3875 | if (add_pin_to_irq_node_nopanic(cfg, node, ioapic, pin)) { |
3862 | printk(KERN_INFO "can not add pin %d for irq %d\n", | 3876 | printk(KERN_INFO "can not add pin %d for irq %d\n", |