]> Zhao Yanbai Git Server - minix.git/commitdiff
ACPI - fixed initialization of pci briges irqtable
authorTomas Hruby <tom@minix3.org>
Tue, 20 Dec 2011 08:03:43 +0000 (08:03 +0000)
committerTomas Hruby <tom@minix3.org>
Tue, 20 Dec 2011 13:10:36 +0000 (13:10 +0000)
- if no IRQ table is found, we report that ACPI cannot map IRQ
  correctly

- fixes mapping of IRQs in KVM because in this case we just fall
  through and use the IRQ configured by BIOS. PCI still reports
  that it failed to use ACPI. It is a hint if things go wrong.

drivers/acpi/pci.c

index fced2d8fdb483fc5104c78311f0d420a258f9b37..1a7a624786b998b6d13dc9856f39a4a122560fc0 100644 (file)
@@ -199,8 +199,6 @@ PRIVATE ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge)
 
        for (i = 0; i < PCI_MAX_DEVICES; i++)
                bridge->children[i] = NULL;
-       for (i = 0; i < IRQ_TABLE_ENTRIES; i++)
-               bridge->irqtable[i] = -1;
 
        for (tbl = (ACPI_PCI_ROUTING_TABLE *)abuff.Pointer; tbl->Length;
                        tbl = (ACPI_PCI_ROUTING_TABLE *)
@@ -232,6 +230,14 @@ PRIVATE ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge)
        return AE_OK;
 }
 
+PRIVATE void bridge_init_irqtable(struct pci_bridge * bridge)
+{
+       int i;
+
+       for (i = 0; i < IRQ_TABLE_ENTRIES; i++)
+               bridge->irqtable[i] = -1;
+}
+
 PRIVATE ACPI_STATUS add_pci_dev(ACPI_HANDLE handle,
                                UINT32 level,
                                void *context,
@@ -264,6 +270,7 @@ PRIVATE ACPI_STATUS add_pci_dev(ACPI_HANDLE handle,
                return AE_NO_MEMORY;
        bridge->handle = handle;
        bridge->parent = parent_bridge;
+       bridge_init_irqtable(bridge);
 
        status =  get_pci_irq_routing(bridge);
        if (!(ACPI_SUCCESS(status))) {
@@ -293,6 +300,7 @@ PRIVATE ACPI_STATUS add_pci_root_dev(ACPI_HANDLE handle,
        pci_root_bridge.primary_bus = -1; /* undefined */
        pci_root_bridge.secondary_bus = 0; /* root bus is 0 in a single root
                                              system */
+       bridge_init_irqtable(&pci_root_bridge);
 
        status = get_pci_irq_routing(&pci_root_bridge);
        if (!ACPI_SUCCESS(status))