summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-09-13 17:29:06 -0400
committerThomas Gleixner <tglx@linutronix.de>2017-09-25 14:38:23 -0400
commitc3e7239a7f43ce1ff407df5f5944bf0d42dc21bf (patch)
tree51c4b4e4276e7827bf972beeb015f0761f48febe
parent07557ccb8c83f315e409ddee181e9ffbf87c6ad1 (diff)
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
-rw-r--r--include/linux/irqdomain.h6
-rw-r--r--kernel/irq/debugfs.c2
-rw-r--r--kernel/irq/irqdomain.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 81e4889ca6dd..1fb50438a868 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -40,6 +40,7 @@ struct of_device_id;
40struct irq_chip; 40struct irq_chip;
41struct irq_data; 41struct irq_data;
42struct cpumask; 42struct cpumask;
43struct seq_file;
43 44
44/* Number of irqs reserved for a legacy isa controller */ 45/* Number of irqs reserved for a legacy isa controller */
45#define NUM_ISA_INTERRUPTS 16 46#define NUM_ISA_INTERRUPTS 16
@@ -104,7 +105,6 @@ struct irq_domain_ops {
104 int (*xlate)(struct irq_domain *d, struct device_node *node, 105 int (*xlate)(struct irq_domain *d, struct device_node *node,
105 const u32 *intspec, unsigned int intsize, 106 const u32 *intspec, unsigned int intsize,
106 unsigned long *out_hwirq, unsigned int *out_type); 107 unsigned long *out_hwirq, unsigned int *out_type);
107
108#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 108#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
109 /* extended V2 interfaces to support hierarchy irq_domains */ 109 /* extended V2 interfaces to support hierarchy irq_domains */
110 int (*alloc)(struct irq_domain *d, unsigned int virq, 110 int (*alloc)(struct irq_domain *d, unsigned int virq,
@@ -116,6 +116,10 @@ struct irq_domain_ops {
116 int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec, 116 int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec,
117 unsigned long *out_hwirq, unsigned int *out_type); 117 unsigned long *out_hwirq, unsigned int *out_type);
118#endif 118#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
119}; 123};
120 124
121extern struct irq_domain_ops irq_generic_chip_ops; 125extern struct irq_domain_ops irq_generic_chip_ops;
diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c
index b7d1023b9b22..7f608ac39653 100644
--- a/kernel/irq/debugfs.c
+++ b/kernel/irq/debugfs.c
@@ -81,6 +81,8 @@ irq_debug_show_data(struct seq_file *m, struct irq_data *data, int ind)
81 data->domain ? data->domain->name : ""); 81 data->domain ? data->domain->name : "");
82 seq_printf(m, "%*shwirq: 0x%lx\n", ind + 1, "", data->hwirq); 82 seq_printf(m, "%*shwirq: 0x%lx\n", ind + 1, "", data->hwirq);
83 irq_debug_show_chip(m, data, ind + 1); 83 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);
84#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 86#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
85 if (!data->parent_data) 87 if (!data->parent_data)
86 return; 88 return;
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index e84b7056bb08..1a75a00ee01f 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1810,6 +1810,8 @@ irq_domain_debug_show_one(struct seq_file *m, struct irq_domain *d, int ind)
1810 d->revmap_size + d->revmap_direct_max_irq); 1810 d->revmap_size + d->revmap_direct_max_irq);
1811 seq_printf(m, "%*smapped: %u\n", ind + 1, "", d->mapcount); 1811 seq_printf(m, "%*smapped: %u\n", ind + 1, "", d->mapcount);
1812 seq_printf(m, "%*sflags: 0x%08x\n", ind +1 , "", d->flags); 1812 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);
1813#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 1815#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
1814 if (!d->parent) 1816 if (!d->parent)
1815 return; 1817 return;