Skip to content

Commit

Permalink
irqdomain: Always update revmap when setting up a virq
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Grant Likely committed Jul 11, 2012
1 parent 913af20 commit 2a71a1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 0 additions & 3 deletions arch/powerpc/sysdev/xics/xics-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 12 additions & 0 deletions kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a71a1a

Please sign in to comment.