|
15 | 15 | #include <linux/mutex.h>
|
16 | 16 | #include <linux/pci.h>
|
17 | 17 | #include <linux/slab.h>
|
| 18 | +#include <linux/seq_file.h> |
18 | 19 | #include <linux/sysfs.h>
|
19 | 20 | #include <linux/types.h>
|
20 | 21 | #include <linux/xarray.h>
|
@@ -756,12 +757,30 @@ static int msi_domain_translate(struct irq_domain *domain, struct irq_fwspec *fw
|
756 | 757 | return info->ops->msi_translate(domain, fwspec, hwirq, type);
|
757 | 758 | }
|
758 | 759 |
|
| 760 | +#ifdef CONFIG_GENERIC_IRQ_DEBUGFS |
| 761 | +static void msi_domain_debug_show(struct seq_file *m, struct irq_domain *d, |
| 762 | + struct irq_data *irqd, int ind) |
| 763 | +{ |
| 764 | + struct msi_desc *desc = irq_data_get_msi_desc(irqd); |
| 765 | + |
| 766 | + if (!desc) |
| 767 | + return; |
| 768 | + |
| 769 | + seq_printf(m, "\n%*saddress_hi: 0x%08x", ind + 1, "", desc->msg.address_hi); |
| 770 | + seq_printf(m, "\n%*saddress_lo: 0x%08x", ind + 1, "", desc->msg.address_lo); |
| 771 | + seq_printf(m, "\n%*smsg_data: 0x%08x\n", ind + 1, "", desc->msg.data); |
| 772 | +} |
| 773 | +#endif |
| 774 | + |
759 | 775 | static const struct irq_domain_ops msi_domain_ops = {
|
760 | 776 | .alloc = msi_domain_alloc,
|
761 | 777 | .free = msi_domain_free,
|
762 | 778 | .activate = msi_domain_activate,
|
763 | 779 | .deactivate = msi_domain_deactivate,
|
764 | 780 | .translate = msi_domain_translate,
|
| 781 | +#ifdef CONFIG_GENERIC_IRQ_DEBUGFS |
| 782 | + .debug_show = msi_domain_debug_show, |
| 783 | +#endif |
765 | 784 | };
|
766 | 785 |
|
767 | 786 | static irq_hw_number_t msi_domain_ops_get_hwirq(struct msi_domain_info *info,
|
|
0 commit comments