[RFC patch 0/4] genirq: Provide adaptive irq oneshot functionality

From: Thomas Gleixner
Date: Wed Dec 15 2010 - 18:13:41 EST


Warning: This is completely untested. Jan managed to confuse me even
way beyond my base confusion level, so testing seems to be the
appropriate reparation.

The final goal of these modifications is to allow an adaptive oneshot
mode for possibly shared interrupts. If the interrupt is not shared
then oneshot mode should be used as it is more efficient than
masking/unmasking at the device level. When the interrupt becomes
shared then the oneshot mode needs to be disabled and device level
masking must be done.

That requires transitioning from one state to the other which needs
the help of the interrupt handler of the device which asked for this
feature.

This has been implemented before by Jan Kiszka in several iterations
and I have to admit that I led Jan down the wrong road when I
suggested to put the shared status into irq_data.

Seems my brain tricked me as I'm about to add a status field to
irq_data for irq chips consumption, but of course that does not help
interrupt handlers as they need to retrieve that information on every
handler invocation, which is involves a radix tree lookup in the worst
case.

Though avoiding the initialy proposed notifier ugliness in the first
place and (ab^H^Hre)using the interrupt handler which has to be aware about
the shared/non shared state already turned out to be a not too bad
idea. Just my init idea sucked a bit.

Instead of retrieving irq_data we encode the shared state and the
transition to it into the lower two bits of the dev_id pointer which
is the second argument to the interrupt handler if and only if the
driver requested the interrupt with the new IRQF_ADAPTIVE_SHARED flag
set.

Thanks,

tglx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/