Skip to content

Commit c3e7239

Browse files
committed
irqdomain/debugfs: Provide domain specific debug callback
Some interrupt domains like the X86 vector domain has special requirements for debugging, like showing the vector usage on the CPUs. Add a callback to the irqdomain ops which can be filled in by domains which require it and add conditional invocations to the irqdomain and the per irq debug files. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Tested-by: Yu Chen <yu.c.chen@intel.com> Acked-by: Juergen Gross <jgross@suse.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Alok Kataria <akataria@vmware.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Rui Zhang <rui.zhang@intel.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Len Brown <lenb@kernel.org> Link: https://lkml.kernel.org/r/20170913213152.512937505@linutronix.de
1 parent 07557cc commit c3e7239

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

include/linux/irqdomain.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ struct of_device_id;
4040
struct irq_chip;
4141
struct irq_data;
4242
struct cpumask;
43+
struct seq_file;
4344

4445
/* Number of irqs reserved for a legacy isa controller */
4546
#define NUM_ISA_INTERRUPTS 16
@@ -104,7 +105,6 @@ struct irq_domain_ops {
104105
int (*xlate)(struct irq_domain *d, struct device_node *node,
105106
const u32 *intspec, unsigned int intsize,
106107
unsigned long *out_hwirq, unsigned int *out_type);
107-
108108
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
109109
/* extended V2 interfaces to support hierarchy irq_domains */
110110
int (*alloc)(struct irq_domain *d, unsigned int virq,
@@ -116,6 +116,10 @@ struct irq_domain_ops {
116116
int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec,
117117
unsigned long *out_hwirq, unsigned int *out_type);
118118
#endif
119+
#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
120+
void (*debug_show)(struct seq_file *m, struct irq_domain *d,
121+
struct irq_data *irqd, int ind);
122+
#endif
119123
};
120124

121125
extern struct irq_domain_ops irq_generic_chip_ops;

kernel/irq/debugfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ irq_debug_show_data(struct seq_file *m, struct irq_data *data, int ind)
8181
data->domain ? data->domain->name : "");
8282
seq_printf(m, "%*shwirq: 0x%lx\n", ind + 1, "", data->hwirq);
8383
irq_debug_show_chip(m, data, ind + 1);
84+
if (data->domain && data->domain->ops && data->domain->ops->debug_show)
85+
data->domain->ops->debug_show(m, NULL, data, ind + 1);
8486
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
8587
if (!data->parent_data)
8688
return;

kernel/irq/irqdomain.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,6 +1810,8 @@ irq_domain_debug_show_one(struct seq_file *m, struct irq_domain *d, int ind)
18101810
d->revmap_size + d->revmap_direct_max_irq);
18111811
seq_printf(m, "%*smapped: %u\n", ind + 1, "", d->mapcount);
18121812
seq_printf(m, "%*sflags: 0x%08x\n", ind +1 , "", d->flags);
1813+
if (d->ops && d->ops->debug_show)
1814+
d->ops->debug_show(m, d, NULL, ind + 1);
18131815
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
18141816
if (!d->parent)
18151817
return;

0 commit comments

Comments
 (0)