irqdomains and irq_domain_add_linear

From: jonsmirl@xxxxxxxxx
Date: Sun Apr 22 2012 - 14:17:53 EST

On ARM with the current Linus tree the irqdomain code doesn't work if
you have multiple linear domains. In my case I have two interrupt
controllers. As the device tree is parsed interrupts get randomly
assigned from each of the two domains. These IRQs get assigned
sequentially ascending VIRQ numbers and sequentially ascending

But then when an interrupt happens, the ARM interrupt handler looks
the interrupt up in the descriptor array. This array is based on virq,
not hwirq. As soon as the 1:1 relationship of virq to hwirq is broken
(it got broken by alternating assignments to the interrupt
controllers) the descriptor lookup stops working since it retrieves
the wrong descriptor. In my case it made the console fail making it
difficult to debug what was happening. I reverted back to
irq_domain_add_legacy() which keeps the 1:1 mapping and everything
started working again.

My initial through to fix this was to add a revmap look up in the
interrupt handler. But a better way might be to keep the descriptor
array corresponding to hwirq instead of virq.

Jon Smirl
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at