Bug 2408 - IRQ15 -> 0:15 -> 0:15
IRQ15 -> 0:15 -> 0:15
Status: CLOSED CODE_FIX
Product: ACPI
Classification: Unclassified
Component: Config-Interrupts
i386 Linux
: P2 normal
Assigned To: Len Brown
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-31 12:44 UTC by Len Brown
Modified: 2004-04-04 21:22 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.5-rc3
Tree: Mainline
Regression: ---


Attachments
proposed fix (i386 and x86_64, vs 2.6.5) (942 bytes, patch)
2004-03-31 12:46 UTC, Len Brown
Details | Diff
dmesg before patch (17.93 KB, text/plain)
2004-03-31 16:25 UTC, Len Brown
Details
dmesg after patch (17.93 KB, text/plain)
2004-03-31 16:26 UTC, Len Brown
Details

Description Len Brown 2004-03-31 12:44:54 UTC
At early at MADT parse time, mp_config_acpi_legacy_irqs() 
creates an mp_irqs[] entry for the IRQs < 16. 
 
Later at IO-APIC initialization time, 
setup_IO_APIC_irqs() goes through all the IOAPIC pins, and for each one 
 idx = find_irq_entry(apic,pin,mp_INT) finds the mp_irqs[] index. 
 irq = pin_2_irq(idx, apic, pin) gets the IRQ back from mp_irqs[].srcbusirq 
 add_pin_to_irq(irq, ioapic, pin) adds that pin to the IRQ irq_2_pin pin-map. 
 
Later the _PRT is processed, and io_apic_set_pci_routing(apic, pin, gsi, flags) 
calls  add_pin_to_irq(irq, ioapic, pin) before setting up the IOAPIC RTE. 
 
The bug is that if the IRQ is < 16, then the pin was added to the IRQ pin-map 
twice eg. 
 
ACPI: PCI Interrupt Link [LM5B] enabled at IRQ 10 
IOAPIC[0]: Set PCI routing entry (14-10 -> 0x79 -> IRQ 10 Mode:1 Active:1) 
00:02:05[B] -> 14-10 -> IRQ 10 
 
ACPI: PCI Interrupt Link [LM1B] enabled at IRQ 15 
IOAPIC[0]: Set PCI routing entry (14-15 -> 0xa1 -> IRQ 15 Mode:1 Active:1) 
00:00:01[B] -> 14-15 -> IRQ 15 
 
IRQ to pin mappings: 
IRQ0 -> 0:0 
IRQ1 -> 0:1 
IRQ3 -> 0:3 
IRQ4 -> 0:4 
IRQ5 -> 0:5 
IRQ6 -> 0:6 
IRQ7 -> 0:7 
IRQ8 -> 0:8 
IRQ9 -> 0:9 
IRQ10 -> 0:10 -> 0:10 
IRQ11 -> 0:11 
IRQ12 -> 0:12 
IRQ13 -> 0:13 
IRQ14 -> 0:14 
IRQ15 -> 0:15 -> 0:15 
 
This causes all physical access to the IOAPIC at run-time to be done twice, 
as if two different pins were involved.  Unknown if this rough edge causes 
any actual run-time failures.
Comment 1 Len Brown 2004-03-31 12:46:43 UTC
Created attachment 2471 [details]
proposed fix (i386 and x86_64, vs 2.6.5)
Comment 2 Len Brown 2004-03-31 16:25:17 UTC
Created attachment 2476 [details]
dmesg before patch
Comment 3 Len Brown 2004-03-31 16:26:30 UTC
Created attachment 2477 [details]
dmesg after patch

thanks to Trond Myklebust for running this test that shows the patch works.
Comment 4 Len Brown 2004-04-04 21:22:31 UTC
fix is in 2.6.5 and > 2.4.26-rc1 -- closing.

Note You need to log in before you can comment on or make changes to this bug.