Skip to content

Commit 0bb4afb

Browse files
committed
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>
1 parent 9bbf877 commit 0bb4afb

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

‎include/linux/irqdomain.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ struct irq_domain_chip_generic;
8989
*/
9090
struct irq_domain {
9191
struct list_head link;
92+
const char *name;
9293

9394
/* type of reverse mapping_technique */
9495
unsigned int revmap_type;

‎kernel/irq/generic-chip.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ int irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip,
305305
/* Calc pointer to the next generic chip */
306306
tmp += sizeof(*gc) + num_ct * sizeof(struct irq_chip_type);
307307
}
308+
d->name = name;
308309
return 0;
309310
}
310311
EXPORT_SYMBOL_GPL(irq_alloc_domain_generic_chips);

‎kernel/irq/irqdomain.c‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,15 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
410410
*/
411411
if (ret != -EPERM) {
412412
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);
414414
}
415415
irq_data->domain = NULL;
416416
irq_data->hwirq = 0;
417417
continue;
418418
}
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;
419422
}
420423

421424
switch (domain->revmap_type) {
@@ -708,8 +711,6 @@ static int virq_debug_show(struct seq_file *m, void *private)
708711
{
709712
unsigned long flags;
710713
struct irq_desc *desc;
711-
const char *p;
712-
static const char none[] = "none";
713714
void *data;
714715
int i;
715716

@@ -731,20 +732,12 @@ static int virq_debug_show(struct seq_file *m, void *private)
731732
seq_printf(m, "0x%05lx ", desc->irq_data.hwirq);
732733

733734
chip = irq_desc_get_chip(desc);
734-
if (chip && chip->name)
735-
p = chip->name;
736-
else
737-
p = none;
738-
seq_printf(m, "%-15s ", p);
735+
seq_printf(m, "%-15s ", (chip && chip->name) ? chip->name : "none");
739736

740737
data = irq_desc_get_chip_data(desc);
741738
seq_printf(m, data ? "0x%p " : " %p ", data);
742739

743-
if (desc->irq_data.domain)
744-
p = of_node_full_name(desc->irq_data.domain->of_node);
745-
else
746-
p = none;
747-
seq_printf(m, "%s\n", p);
740+
seq_printf(m, "%s\n", desc->irq_data.domain->name);
748741
}
749742

750743
raw_spin_unlock_irqrestore(&desc->lock, flags);

0 commit comments

Comments
 (0)