@@ -203,6 +203,8 @@ static int acpi_pci_irq_find_prt_entry(struct pci_dev *dev,
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_pci_routing_table *entry;
acpi_handle handle = NULL;
+ struct acpi_prt_entry *match = NULL;
+ const char *match_int_source = NULL;
if (dev->bus->bridge)
handle = ACPI_HANDLE(dev->bus->bridge);
@@ -219,13 +221,31 @@ static int acpi_pci_irq_find_prt_entry(struct pci_dev *dev,
entry = buffer.pointer;
while (entry && (entry->length > 0)) {
- if (!acpi_pci_irq_check_entry(handle, dev, pin,
- entry, entry_ptr))
- break;
+ struct acpi_prt_entry *curr;
+
+ if (!acpi_pci_irq_check_entry(handle, dev, pin, entry, &curr)) {
+ if (!match) {
+ match = curr;
+ match_int_source = entry->source;
+ } else {
+ pr_err(FW_BUG
+ "ACPI _PRT returned duplicate IRQ routing entries for device %04x:%02x:%02x[INT%c]: %s[%d] and %s[%d]\n",
+ curr->id.segment, curr->id.bus, curr->id.device,
+ pin_name(curr->pin),
+ match_int_source, match->index,
+ entry->source, curr->index);
+ /* We use the first matching entry nonetheless,
+ * for compatibility with older kernels.
+ */
+ }
+ }
+
entry = (struct acpi_pci_routing_table *)
((unsigned long)entry + entry->length);
}
+ *entry_ptr = match;
+
kfree(buffer.pointer);
return 0;
}