aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-06-06 09:23:30 -0400
committerGrant Likely <grant.likely@linaro.org>2013-06-10 06:52:09 -0400
commit0bb4afb45dd1add73ca643a865daa38716aeff0c (patch)
tree540936db8e602ec491d667d9f04583bf7d7f3240
parent9bbf877d3b6b8c5991000296f40a3f0fe66fa89b (diff)
irqdomain: Add a name field
This patch adds a name field to the irq_domain structure to help mere mortals understand the mappings between irq domains and virqs. It also converts a number of places that have open-coded some kind of fudging an irqdomain name to use the new field. This means a more consistent display of names in irq domain log messages and debugfs output. Signed-off-by: Grant Likely <grant.likely@linaro.org>
-rw-r--r--include/linux/irqdomain.h1
-rw-r--r--kernel/irq/generic-chip.c1
-rw-r--r--kernel/irq/irqdomain.c19
3 files changed, 8 insertions, 13 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 6f062416e5bf..e5e513c2d104 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -89,6 +89,7 @@ struct irq_domain_chip_generic;
89 */ 89 */
90struct irq_domain { 90struct irq_domain {
91 struct list_head link; 91 struct list_head link;
92 const char *name;
92 93
93 /* type of reverse mapping_technique */ 94 /* type of reverse mapping_technique */
94 unsigned int revmap_type; 95 unsigned int revmap_type;
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index 95575d8d5392..ca98cc5d6308 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -305,6 +305,7 @@ int irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip,
305 /* Calc pointer to the next generic chip */ 305 /* Calc pointer to the next generic chip */
306 tmp += sizeof(*gc) + num_ct * sizeof(struct irq_chip_type); 306 tmp += sizeof(*gc) + num_ct * sizeof(struct irq_chip_type);
307 } 307 }
308 d->name = name;
308 return 0; 309 return 0;
309} 310}
310EXPORT_SYMBOL_GPL(irq_alloc_domain_generic_chips); 311EXPORT_SYMBOL_GPL(irq_alloc_domain_generic_chips);
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 1ac8cf41b9a5..b1b5e6793fd2 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -410,12 +410,15 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
410 */ 410 */
411 if (ret != -EPERM) { 411 if (ret != -EPERM) {
412 pr_info("%s didn't like hwirq-0x%lx to VIRQ%i mapping (rc=%d)\n", 412 pr_info("%s didn't like hwirq-0x%lx to VIRQ%i mapping (rc=%d)\n",
413 of_node_full_name(domain->of_node), hwirq, virq, ret); 413 domain->name, hwirq, virq, ret);
414 } 414 }
415 irq_data->domain = NULL; 415 irq_data->domain = NULL;
416 irq_data->hwirq = 0; 416 irq_data->hwirq = 0;
417 continue; 417 continue;
418 } 418 }
419 /* If not already assigned, give the domain the chip's name */
420 if (!domain->name && irq_data->chip)
421 domain->name = irq_data->chip->name;
419 } 422 }
420 423
421 switch (domain->revmap_type) { 424 switch (domain->revmap_type) {
@@ -708,8 +711,6 @@ static int virq_debug_show(struct seq_file *m, void *private)
708{ 711{
709 unsigned long flags; 712 unsigned long flags;
710 struct irq_desc *desc; 713 struct irq_desc *desc;
711 const char *p;
712 static const char none[] = "none";
713 void *data; 714 void *data;
714 int i; 715 int i;
715 716
@@ -731,20 +732,12 @@ static int virq_debug_show(struct seq_file *m, void *private)
731 seq_printf(m, "0x%05lx ", desc->irq_data.hwirq); 732 seq_printf(m, "0x%05lx ", desc->irq_data.hwirq);
732 733
733 chip = irq_desc_get_chip(desc); 734 chip = irq_desc_get_chip(desc);
734 if (chip && chip->name) 735 seq_printf(m, "%-15s ", (chip && chip->name) ? chip->name : "none");
735 p = chip->name;
736 else
737 p = none;
738 seq_printf(m, "%-15s ", p);
739 736
740 data = irq_desc_get_chip_data(desc); 737 data = irq_desc_get_chip_data(desc);
741 seq_printf(m, data ? "0x%p " : " %p ", data); 738 seq_printf(m, data ? "0x%p " : " %p ", data);
742 739
743 if (desc->irq_data.domain) 740 seq_printf(m, "%s\n", desc->irq_data.domain->name);
744 p = of_node_full_name(desc->irq_data.domain->of_node);
745 else
746 p = none;
747 seq_printf(m, "%s\n", p);
748 } 741 }
749 742
750 raw_spin_unlock_irqrestore(&desc->lock, flags); 743 raw_spin_unlock_irqrestore(&desc->lock, flags);