aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-06-04 01:04:37 -0400
committerGrant Likely <grant.likely@secretlab.ca>2012-07-11 11:16:00 -0400
commitd6b0d1f7058f7cf818138cd7fd116dca3f3576d9 (patch)
tree77badaee27c21a63f5de73b7b4483824208245ec /kernel
parent98aa468e045a0091a7c34d9f5205a629634fabf4 (diff)
irqdomain: Eliminate dedicated radix lookup functions
In preparation to remove the slow revmap path, eliminate the public radix revmap lookup functions. This simplifies the code and makes the slowpath removal patch a lot simpler. 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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/irqdomain.c60
1 files changed, 1 insertions, 59 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index a07d92446b66..f540bb1eff84 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -450,7 +450,7 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
450 break; 450 break;
451 case IRQ_DOMAIN_MAP_TREE: 451 case IRQ_DOMAIN_MAP_TREE:
452 mutex_lock(&revmap_trees_mutex); 452 mutex_lock(&revmap_trees_mutex);
453 irq_radix_revmap_insert(domain, virq, hwirq); 453 radix_tree_insert(&domain->revmap_data.tree, hwirq, irq_data);
454 mutex_unlock(&revmap_trees_mutex); 454 mutex_unlock(&revmap_trees_mutex);
455 break; 455 break;
456 } 456 }
@@ -724,64 +724,6 @@ unsigned int irq_find_mapping(struct irq_domain *domain,
724EXPORT_SYMBOL_GPL(irq_find_mapping); 724EXPORT_SYMBOL_GPL(irq_find_mapping);
725 725
726/** 726/**
727 * irq_radix_revmap_lookup() - Find a linux irq from a hw irq number.
728 * @domain: domain owning this hardware interrupt
729 * @hwirq: hardware irq number in that domain space
730 *
731 * This is a fast path, for use by irq controller code that uses radix tree
732 * revmaps
733 */
734unsigned int irq_radix_revmap_lookup(struct irq_domain *domain,
735 irq_hw_number_t hwirq)
736{
737 struct irq_data *irq_data;
738
739 if (WARN_ON_ONCE(domain->revmap_type != IRQ_DOMAIN_MAP_TREE))
740 return irq_find_mapping(domain, hwirq);
741
742 /*
743 * Freeing an irq can delete nodes along the path to
744 * do the lookup via call_rcu.
745 */
746 rcu_read_lock();
747 irq_data = radix_tree_lookup(&domain->revmap_data.tree, hwirq);
748 rcu_read_unlock();
749
750 /*
751 * If found in radix tree, then fine.
752 * Else fallback to linear lookup - this should not happen in practice
753 * as it means that we failed to insert the node in the radix tree.
754 */
755 return irq_data ? irq_data->irq : irq_find_mapping(domain, hwirq);
756}
757EXPORT_SYMBOL_GPL(irq_radix_revmap_lookup);
758
759/**
760 * irq_radix_revmap_insert() - Insert a hw irq to linux irq number mapping.
761 * @domain: domain owning this hardware interrupt
762 * @virq: linux irq number
763 * @hwirq: hardware irq number in that domain space
764 *
765 * This is for use by irq controllers that use a radix tree reverse
766 * mapping for fast lookup.
767 */
768void irq_radix_revmap_insert(struct irq_domain *domain, unsigned int virq,
769 irq_hw_number_t hwirq)
770{
771 struct irq_data *irq_data = irq_get_irq_data(virq);
772
773 if (WARN_ON(domain->revmap_type != IRQ_DOMAIN_MAP_TREE))
774 return;
775
776 if (virq) {
777 mutex_lock(&revmap_trees_mutex);
778 radix_tree_insert(&domain->revmap_data.tree, hwirq, irq_data);
779 mutex_unlock(&revmap_trees_mutex);
780 }
781}
782EXPORT_SYMBOL_GPL(irq_radix_revmap_insert);
783
784/**
785 * irq_linear_revmap() - Find a linux irq from a hw irq number. 727 * irq_linear_revmap() - Find a linux irq from a hw irq number.
786 * @domain: domain owning this hardware interrupt 728 * @domain: domain owning this hardware interrupt
787 * @hwirq: hardware irq number in that domain space 729 * @hwirq: hardware irq number in that domain space