aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorSebastien Dugue <sebastien.dugue@bull.net>2008-09-04 08:37:07 -0400
committerPaul Mackerras <paulus@samba.org>2008-09-15 14:08:44 -0400
commit967e012ef306e99cfddcd7423f37414e6b568361 (patch)
treeb265dc79fcc5d46d8397a01bd310cabfa3a2e28e /arch/powerpc/include/asm
parentaaf4a9b0f78786e6915077cbbb1d6f4fb6a8ee0b (diff)
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>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/irq.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index a372f76836c2..0a5137676e1b 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -236,15 +236,27 @@ extern unsigned int irq_find_mapping(struct irq_host *host,
236extern unsigned int irq_create_direct_mapping(struct irq_host *host); 236extern unsigned int irq_create_direct_mapping(struct irq_host *host);
237 237
238/** 238/**
239 * irq_radix_revmap - Find a linux virq from a hw irq number. 239 * irq_radix_revmap_insert - Insert a hw irq to linux virq number mapping.
240 * @host: host owning this hardware interrupt
241 * @virq: linux irq number
242 * @hwirq: hardware irq number in that host space
243 *
244 * This is for use by irq controllers that use a radix tree reverse
245 * mapping for fast lookup.
246 */
247extern void irq_radix_revmap_insert(struct irq_host *host, unsigned int virq,
248 irq_hw_number_t hwirq);
249
250/**
251 * irq_radix_revmap_lookup - Find a linux virq from a hw irq number.
240 * @host: host owning this hardware interrupt 252 * @host: host owning this hardware interrupt
241 * @hwirq: hardware irq number in that host space 253 * @hwirq: hardware irq number in that host space
242 * 254 *
243 * This is a fast path, for use by irq controller code that uses radix tree 255 * This is a fast path, for use by irq controller code that uses radix tree
244 * revmaps 256 * revmaps
245 */ 257 */
246extern unsigned int irq_radix_revmap(struct irq_host *host, 258extern unsigned int irq_radix_revmap_lookup(struct irq_host *host,
247 irq_hw_number_t hwirq); 259 irq_hw_number_t hwirq);
248 260
249/** 261/**
250 * irq_linear_revmap - Find a linux virq from a hw irq number. 262 * irq_linear_revmap - Find a linux virq from a hw irq number.