From 71533c8a8347fa31abda187a5c7012a20e1d27bd Mon Sep 17 00:00:00 2001 From: Tomas Hruby Date: Tue, 20 Dec 2011 08:03:43 +0000 Subject: [PATCH] ACPI - fixed initialization of pci briges irqtable - 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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci.c b/drivers/acpi/pci.c index fced2d8fd..1a7a62478 100644 --- a/drivers/acpi/pci.c +++ b/drivers/acpi/pci.c @@ -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))