From: Grant Likely Date: Mon, 4 Jun 2012 05:04:36 +0000 (-0700) Subject: irqdomain: Always update revmap when setting up a virq X-Git-Tag: v3.6-rc1~23^2~6 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2a71a1a9da40dfbd5b23d4312aa1641385581f4a;p=uclinux-h8%2Flinux.git 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 Cc: Paul Mundt Cc: Benjamin Herrenschmidt Cc: Thomas Gleixner Cc: Rob Herring --- 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, pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw); - /* Insert the interrupt mapping into the radix tree for fast lookup */ - irq_radix_revmap_insert(xics_host, virq, hw); - /* They aren't all level sensitive but we just don't really know */ irq_set_status_flags(virq, IRQ_LEVEL); 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, return -1; } + switch (domain->revmap_type) { + case IRQ_DOMAIN_MAP_LINEAR: + if (hwirq < domain->revmap_data.linear.size) + domain->revmap_data.linear.revmap[hwirq] = virq; + break; + case IRQ_DOMAIN_MAP_TREE: + mutex_lock(&revmap_trees_mutex); + irq_radix_revmap_insert(domain, virq, hwirq); + mutex_unlock(&revmap_trees_mutex); + break; + } + irq_clear_status_flags(virq, IRQ_NOREQUEST); return 0;