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 b758d49b811c..e4e0ddcb1546 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1474,7 +1474,7 @@ static struct { | |||
1474 | 1474 | ||
1475 | static void __init setup_IO_APIC_irqs(void) | 1475 | static void __init setup_IO_APIC_irqs(void) |
1476 | { | 1476 | { |
1477 | int apic_id = 0, pin, idx, irq; | 1477 | int apic_id, pin, idx, irq; |
1478 | int notcon = 0; | 1478 | int notcon = 0; |
1479 | struct irq_desc *desc; | 1479 | struct irq_desc *desc; |
1480 | struct irq_cfg *cfg; | 1480 | struct irq_cfg *cfg; |
@@ -1482,14 +1482,7 @@ static void __init setup_IO_APIC_irqs(void) | |||
1482 | 1482 | ||
1483 | apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n"); | 1483 | apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n"); |
1484 | 1484 | ||
1485 | #ifdef CONFIG_ACPI | 1485 | for (apic_id = 0; apic_id < nr_ioapics; apic_id++) |
1486 | if (!acpi_disabled && acpi_ioapic) { | ||
1487 | apic_id = mp_find_ioapic(0); | ||
1488 | if (apic_id < 0) | ||
1489 | apic_id = 0; | ||
1490 | } | ||
1491 | #endif | ||
1492 | |||
1493 | for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) { | 1486 | for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) { |
1494 | idx = find_irq_entry(apic_id, pin, mp_INT); | 1487 | idx = find_irq_entry(apic_id, pin, mp_INT); |
1495 | if (idx == -1) { | 1488 | if (idx == -1) { |
@@ -1511,6 +1504,9 @@ static void __init setup_IO_APIC_irqs(void) | |||
1511 | 1504 | ||
1512 | irq = pin_2_irq(idx, apic_id, pin); | 1505 | irq = pin_2_irq(idx, apic_id, pin); |
1513 | 1506 | ||
1507 | if ((apic_id > 0) && (irq > 16)) | ||
1508 | continue; | ||
1509 | |||
1514 | /* | 1510 | /* |
1515 | * Skip the timer IRQ if there's a quirk handler | 1511 | * Skip the timer IRQ if there's a quirk handler |
1516 | * installed and if it returns 1: | 1512 | * installed and if it returns 1: |
@@ -1698,7 +1694,7 @@ __apicdebuginit(void) print_IO_APIC(void) | |||
1698 | printk(KERN_DEBUG ".... IRQ redirection table:\n"); | 1694 | printk(KERN_DEBUG ".... IRQ redirection table:\n"); |
1699 | 1695 | ||
1700 | printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol" | 1696 | printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol" |
1701 | " Stat Dmod Deli Vect: \n"); | 1697 | " Stat Dmod Deli Vect:\n"); |
1702 | 1698 | ||
1703 | for (i = 0; i <= reg_01.bits.entries; i++) { | 1699 | for (i = 0; i <= reg_01.bits.entries; i++) { |
1704 | struct IO_APIC_route_entry entry; | 1700 | struct IO_APIC_route_entry entry; |
@@ -3875,6 +3871,28 @@ void __init probe_nr_irqs_gsi(void) | |||
3875 | printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi); | 3871 | printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi); |
3876 | } | 3872 | } |
3877 | 3873 | ||
3874 | #ifdef CONFIG_SPARSE_IRQ | ||
3875 | int __init arch_probe_nr_irqs(void) | ||
3876 | { | ||
3877 | int nr; | ||
3878 | |||
3879 | if (nr_irqs > (NR_VECTORS * nr_cpu_ids)) | ||
3880 | nr_irqs = NR_VECTORS * nr_cpu_ids; | ||
3881 | |||
3882 | nr = nr_irqs_gsi + 8 * nr_cpu_ids; | ||
3883 | #if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ) | ||
3884 | /* | ||
3885 | * for MSI and HT dyn irq | ||
3886 | */ | ||
3887 | nr += nr_irqs_gsi * 16; | ||
3888 | #endif | ||
3889 | if (nr < nr_irqs) | ||
3890 | nr_irqs = nr; | ||
3891 | |||
3892 | return 0; | ||
3893 | } | ||
3894 | #endif | ||
3895 | |||
3878 | static int __io_apic_set_pci_routing(struct device *dev, int irq, | 3896 | static int __io_apic_set_pci_routing(struct device *dev, int irq, |
3879 | struct io_apic_irq_attr *irq_attr) | 3897 | struct io_apic_irq_attr *irq_attr) |
3880 | { | 3898 | { |
@@ -4082,27 +4100,23 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) | |||
4082 | #ifdef CONFIG_SMP | 4100 | #ifdef CONFIG_SMP |
4083 | void __init setup_ioapic_dest(void) | 4101 | void __init setup_ioapic_dest(void) |
4084 | { | 4102 | { |
4085 | int pin, ioapic = 0, irq, irq_entry; | 4103 | int pin, ioapic, irq, irq_entry; |
4086 | struct irq_desc *desc; | 4104 | struct irq_desc *desc; |
4087 | const struct cpumask *mask; | 4105 | const struct cpumask *mask; |
4088 | 4106 | ||
4089 | if (skip_ioapic_setup == 1) | 4107 | if (skip_ioapic_setup == 1) |
4090 | return; | 4108 | return; |
4091 | 4109 | ||
4092 | #ifdef CONFIG_ACPI | 4110 | for (ioapic = 0; ioapic < nr_ioapics; ioapic++) |
4093 | if (!acpi_disabled && acpi_ioapic) { | ||
4094 | ioapic = mp_find_ioapic(0); | ||
4095 | if (ioapic < 0) | ||
4096 | ioapic = 0; | ||
4097 | } | ||
4098 | #endif | ||
4099 | |||
4100 | for (pin = 0; pin < nr_ioapic_registers[ioapic]; pin++) { | 4111 | for (pin = 0; pin < nr_ioapic_registers[ioapic]; pin++) { |
4101 | irq_entry = find_irq_entry(ioapic, pin, mp_INT); | 4112 | irq_entry = find_irq_entry(ioapic, pin, mp_INT); |
4102 | if (irq_entry == -1) | 4113 | if (irq_entry == -1) |
4103 | continue; | 4114 | continue; |
4104 | irq = pin_2_irq(irq_entry, ioapic, pin); | 4115 | irq = pin_2_irq(irq_entry, ioapic, pin); |
4105 | 4116 | ||
4117 | if ((ioapic > 0) && (irq > 16)) | ||
4118 | continue; | ||
4119 | |||
4106 | desc = irq_to_desc(irq); | 4120 | desc = irq_to_desc(irq); |
4107 | 4121 | ||
4108 | /* | 4122 | /* |