irqdomain: merge linear and tree reverse mappings.
authorGrant Likely <grant.likely@secretlab.ca>
Wed, 11 Jul 2012 16:24:31 +0000 (17:24 +0100)
committerGrant Likely <grant.likely@linaro.org>
Mon, 10 Jun 2013 10:52:09 +0000 (11:52 +0100)
commitcef5075c8c238ffd04c86a77a5a9bdbd18031137
tree0163ec330ce81f90375ee1208c27d4e063a0e89f
parent0bb4afb45dd1add73ca643a865daa38716aeff0c
irqdomain: merge linear and tree reverse mappings.

Keeping them separate makes irq_domain more complex and adds a lot of
code (as proven by the diffstat).  Merging them simplifies the whole
scheme.  This change makes it so both the tree and linear methods can be
used by the same irq_domain instance.  If the hwirq is less than the
->linear_size, then the linear map is used to reverse map the hwirq.
Otherwise the radix tree is used.  The test for which map to use is no
more expensive that the existing code, so the performance of fast path
is preserved.

It also means that complex interrupt controllers can use both the
linear map and a tree in the same domain.  This may be useful for an
interrupt controller with a base set of core irqs and a large number
of GPIOs which might be used as irqs.  The linear map could cover the
core irqs, and the tree used for thas irqs.  The linear map could
cover the core irqs, and the tree used for the gpios.

v2: Drop reorganization of revmap data

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
include/linux/irqdomain.h
kernel/irq/irqdomain.c