]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Separate the irq radix tree insertion and lookup
authorSebastien Dugue <sebastien.dugue@bull.net>
Thu, 4 Sep 2008 12:37:07 +0000 (22:37 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 15 Sep 2008 18:08:44 +0000 (11:08 -0700)
commitf1c6844aedeae3f9102c65b7849f6368062620fb
treeb265dc79fcc5d46d8397a01bd310cabfa3a2e28e
parentaf4df4c3600ed196e267e3d58c607e4a5027c074
powerpc: Separate the irq radix tree insertion and lookup

irq_radix_revmap() currently serves 2 purposes, irq mapping lookup
and insertion which happen in interrupt and process context respectively.

Separate the function into its 2 components, one for lookup only and one
for insertion only.

Fix the only user of the revmap tree (XICS) to use the new functions.

Also, move the insertion into the radix tree of those irqs that were
requested before it was initialized at said tree initialization.

Mutual exclusion between the tree initialization and readers/writers is
handled via a state variable (revmap_trees_allocated) set to 1 when the tree
has been initialized and set to 2 after the already requested irqs have been
inserted in the tree by the init path. This state is checked before any reader
or writer access just like we used to check for tree.gfp_mask != 0 before.

Finally, now that we're not any longer inserting nodes into the radix-tree
in interrupt context, turn the GFP_ATOMIC allocations into GFP_KERNEL ones.

Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/include/asm/irq.h
arch/powerpc/kernel/irq.c
arch/powerpc/platforms/pseries/xics.c