summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/irqdesc.h1
-rw-r--r--kernel/irq/debugfs.c10
-rw-r--r--kernel/irq/internals.h5
-rw-r--r--kernel/irq/msi.c6
4 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 3e90a094798d..b55b113c049b 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -93,6 +93,7 @@ struct irq_desc {
93#endif 93#endif
94#ifdef CONFIG_GENERIC_IRQ_DEBUGFS 94#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
95 struct dentry *debugfs_file; 95 struct dentry *debugfs_file;
96 const char *dev_name;
96#endif 97#endif
97#ifdef CONFIG_SPARSE_IRQ 98#ifdef CONFIG_SPARSE_IRQ
98 struct rcu_head rcu; 99 struct rcu_head rcu;
diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c
index c3fdb36dec30..b7d1023b9b22 100644
--- a/kernel/irq/debugfs.c
+++ b/kernel/irq/debugfs.c
@@ -149,6 +149,7 @@ static int irq_debug_show(struct seq_file *m, void *p)
149 raw_spin_lock_irq(&desc->lock); 149 raw_spin_lock_irq(&desc->lock);
150 data = irq_desc_get_irq_data(desc); 150 data = irq_desc_get_irq_data(desc);
151 seq_printf(m, "handler: %pf\n", desc->handle_irq); 151 seq_printf(m, "handler: %pf\n", desc->handle_irq);
152 seq_printf(m, "device: %s\n", desc->dev_name);
152 seq_printf(m, "status: 0x%08x\n", desc->status_use_accessors); 153 seq_printf(m, "status: 0x%08x\n", desc->status_use_accessors);
153 irq_debug_show_bits(m, 0, desc->status_use_accessors, irqdesc_states, 154 irq_debug_show_bits(m, 0, desc->status_use_accessors, irqdesc_states,
154 ARRAY_SIZE(irqdesc_states)); 155 ARRAY_SIZE(irqdesc_states));
@@ -226,6 +227,15 @@ static const struct file_operations dfs_irq_ops = {
226 .release = single_release, 227 .release = single_release,
227}; 228};
228 229
230void irq_debugfs_copy_devname(int irq, struct device *dev)
231{
232 struct irq_desc *desc = irq_to_desc(irq);
233 const char *name = dev_name(dev);
234
235 if (name)
236 desc->dev_name = kstrdup(name, GFP_KERNEL);
237}
238
229void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc) 239void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc)
230{ 240{
231 char name [10]; 241 char name [10];
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index a4aa39009f0d..cfaec2669093 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -443,7 +443,9 @@ void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc);
443static inline void irq_remove_debugfs_entry(struct irq_desc *desc) 443static inline void irq_remove_debugfs_entry(struct irq_desc *desc)
444{ 444{
445 debugfs_remove(desc->debugfs_file); 445 debugfs_remove(desc->debugfs_file);
446 kfree(desc->dev_name);
446} 447}
448void irq_debugfs_copy_devname(int irq, struct device *dev);
447# ifdef CONFIG_IRQ_DOMAIN 449# ifdef CONFIG_IRQ_DOMAIN
448void irq_domain_debugfs_init(struct dentry *root); 450void irq_domain_debugfs_init(struct dentry *root);
449# else 451# else
@@ -458,4 +460,7 @@ static inline void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *d)
458static inline void irq_remove_debugfs_entry(struct irq_desc *d) 460static inline void irq_remove_debugfs_entry(struct irq_desc *d)
459{ 461{
460} 462}
463static inline void irq_debugfs_copy_devname(int irq, struct device *dev)
464{
465}
461#endif /* CONFIG_GENERIC_IRQ_DEBUGFS */ 466#endif /* CONFIG_GENERIC_IRQ_DEBUGFS */
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 3fa4bd59f569..94ecc0293844 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -16,6 +16,8 @@
16#include <linux/msi.h> 16#include <linux/msi.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18 18
19#include "internals.h"
20
19/** 21/**
20 * alloc_msi_entry - Allocate an initialize msi_entry 22 * alloc_msi_entry - Allocate an initialize msi_entry
21 * @dev: Pointer to the device for which this is allocated 23 * @dev: Pointer to the device for which this is allocated
@@ -373,8 +375,10 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
373 return ret; 375 return ret;
374 } 376 }
375 377
376 for (i = 0; i < desc->nvec_used; i++) 378 for (i = 0; i < desc->nvec_used; i++) {
377 irq_set_msi_desc_off(virq, i, desc); 379 irq_set_msi_desc_off(virq, i, desc);
380 irq_debugfs_copy_devname(virq + i, dev);
381 }
378 } 382 }
379 383
380 if (ops->msi_finish) 384 if (ops->msi_finish)