aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-06-04 01:04:36 -0400
committerGrant Likely <grant.likely@secretlab.ca>2012-07-11 11:15:34 -0400
commit2a71a1a9da40dfbd5b23d4312aa1641385581f4a (patch)
tree9a246c0aa997d98acb9a931e10331468a3661ac0
parent913af2070731bfc1bd39bb35c5cd2fd66f5eff12 (diff)
irqdomain: Always update revmap when setting up a virq
At irq_setup_virq() time all of the data needed to update the reverse map is available, but the current code ignores it and relies upon the slow path to insert revmap records. This patch adds revmap updating to the setup path so the slow path will no longer be necessary. 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>
-rw-r--r--arch/powerpc/sysdev/xics/xics-common.c3
-rw-r--r--kernel/irq/irqdomain.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c
index cd1d18db92c6..9049d9f44485 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -329,9 +329,6 @@ static int xics_host_map(struct irq_domain *h, unsigned int virq,
329 329
330 pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw); 330 pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw);
331 331
332 /* Insert the interrupt mapping into the radix tree for fast lookup */
333 irq_radix_revmap_insert(xics_host, virq, hw);
334
335 /* They aren't all level sensitive but we just don't really know */ 332 /* They aren't all level sensitive but we just don't really know */
336 irq_set_status_flags(virq, IRQ_LEVEL); 333 irq_set_status_flags(virq, IRQ_LEVEL);
337 334
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 17634f2c9f6c..091732c9dbdc 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -424,6 +424,18 @@ static int irq_setup_virq(struct irq_domain *domain, unsigned int virq,
424 return -1; 424 return -1;
425 } 425 }
426 426
427 switch (domain->revmap_type) {
428 case IRQ_DOMAIN_MAP_LINEAR:
429 if (hwirq < domain->revmap_data.linear.size)
430 domain->revmap_data.linear.revmap[hwirq] = virq;
431 break;
432 case IRQ_DOMAIN_MAP_TREE:
433 mutex_lock(&revmap_trees_mutex);
434 irq_radix_revmap_insert(domain, virq, hwirq);
435 mutex_unlock(&revmap_trees_mutex);
436 break;
437 }
438
427 irq_clear_status_flags(virq, IRQ_NOREQUEST); 439 irq_clear_status_flags(virq, IRQ_NOREQUEST);
428 440
429 return 0; 441 return 0;