diff options
Diffstat (limited to 'arch/x86_64/kernel/mpparse.c')
-rw-r--r-- | arch/x86_64/kernel/mpparse.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index b8d53dfa9931..b147ab19fbd4 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -790,20 +790,11 @@ void __init mp_config_acpi_legacy_irqs(void) | |||
790 | } | 790 | } |
791 | } | 791 | } |
792 | 792 | ||
793 | #define MAX_GSI_NUM 4096 | ||
794 | |||
795 | int mp_register_gsi(u32 gsi, int triggering, int polarity) | 793 | int mp_register_gsi(u32 gsi, int triggering, int polarity) |
796 | { | 794 | { |
797 | int ioapic = -1; | 795 | int ioapic = -1; |
798 | int ioapic_pin = 0; | 796 | int ioapic_pin = 0; |
799 | int idx, bit = 0; | 797 | int idx, bit = 0; |
800 | static int pci_irq = 16; | ||
801 | /* | ||
802 | * Mapping between Global System Interrupts, which | ||
803 | * represent all possible interrupts, to the IRQs | ||
804 | * assigned to actual devices. | ||
805 | */ | ||
806 | static int gsi_to_irq[MAX_GSI_NUM]; | ||
807 | 798 | ||
808 | if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) | 799 | if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) |
809 | return gsi; | 800 | return gsi; |
@@ -836,42 +827,11 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) | |||
836 | if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) { | 827 | if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) { |
837 | Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n", | 828 | Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n", |
838 | mp_ioapic_routing[ioapic].apic_id, ioapic_pin); | 829 | mp_ioapic_routing[ioapic].apic_id, ioapic_pin); |
839 | return gsi_to_irq[gsi]; | 830 | return gsi; |
840 | } | 831 | } |
841 | 832 | ||
842 | mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit); | 833 | mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit); |
843 | 834 | ||
844 | if (triggering == ACPI_LEVEL_SENSITIVE) { | ||
845 | /* | ||
846 | * For PCI devices assign IRQs in order, avoiding gaps | ||
847 | * due to unused I/O APIC pins. | ||
848 | */ | ||
849 | int irq = gsi; | ||
850 | if (gsi < MAX_GSI_NUM) { | ||
851 | /* | ||
852 | * Retain the VIA chipset work-around (gsi > 15), but | ||
853 | * avoid a problem where the 8254 timer (IRQ0) is setup | ||
854 | * via an override (so it's not on pin 0 of the ioapic), | ||
855 | * and at the same time, the pin 0 interrupt is a PCI | ||
856 | * type. The gsi > 15 test could cause these two pins | ||
857 | * to be shared as IRQ0, and they are not shareable. | ||
858 | * So test for this condition, and if necessary, avoid | ||
859 | * the pin collision. | ||
860 | */ | ||
861 | if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0)) | ||
862 | gsi = pci_irq++; | ||
863 | /* | ||
864 | * Don't assign IRQ used by ACPI SCI | ||
865 | */ | ||
866 | if (gsi == acpi_fadt.sci_int) | ||
867 | gsi = pci_irq++; | ||
868 | gsi_to_irq[irq] = gsi; | ||
869 | } else { | ||
870 | printk(KERN_ERR "GSI %u is too high\n", gsi); | ||
871 | return gsi; | ||
872 | } | ||
873 | } | ||
874 | |||
875 | io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, | 835 | io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, |
876 | triggering == ACPI_EDGE_SENSITIVE ? 0 : 1, | 836 | triggering == ACPI_EDGE_SENSITIVE ? 0 : 1, |
877 | polarity == ACPI_ACTIVE_HIGH ? 0 : 1); | 837 | polarity == ACPI_ACTIVE_HIGH ? 0 : 1); |