ACPI / PCI: fix GIC irq model default PCI IRQ polarity
[cascardo/linux.git] / drivers / acpi / pci_irq.c
index 2c45dd3..c576a6f 100644 (file)
@@ -411,7 +411,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
        int gsi;
        u8 pin;
        int triggering = ACPI_LEVEL_SENSITIVE;
-       int polarity = ACPI_ACTIVE_LOW;
+       /*
+        * On ARM systems with the GIC interrupt model, level interrupts
+        * are always polarity high by specification; PCI legacy
+        * IRQs lines are inverted before reaching the interrupt
+        * controller and must therefore be considered active high
+        * as default.
+        */
+       int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ?
+                                     ACPI_ACTIVE_HIGH : ACPI_ACTIVE_LOW;
        char *link = NULL;
        char link_desc[16];
        int rc;