summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-12-11 01:18:49 +0300
committerThomas Gleixner <tglx@linutronix.de>2021-12-17 00:16:37 +0300
commit6ef7f771de0182141ef1a0863f27b12963e1d184 (patch)
treeb3b744ee4a255782349f187bdce07d4a6ab4d279 /kernel
parentb3f82364117a0b7f666ce023195b636c4803c46c (diff)
downloadlinux-6ef7f771de0182141ef1a0863f27b12963e1d184.tar.xz
genirq/msi: Use PCI device property
to determine whether this is MSI or MSIX instead of consulting MSI descriptors. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Michael Kelley <mikelley@microsoft.com> Tested-by: Nishanth Menon <nm@ti.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20211210221813.434156196@linutronix.de
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/msi.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 4a7a7f0f5102..b3f73ef0376c 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -77,21 +77,8 @@ EXPORT_SYMBOL_GPL(get_cached_msi_msg);
static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct msi_desc *entry;
- bool is_msix = false;
- unsigned long irq;
- int retval;
-
- retval = kstrtoul(attr->attr.name, 10, &irq);
- if (retval)
- return retval;
-
- entry = irq_get_msi_desc(irq);
- if (!entry)
- return -ENODEV;
-
- if (dev_is_pci(dev))
- is_msix = entry->pci.msi_attrib.is_msix;
+ /* MSI vs. MSIX is per device not per interrupt */
+ bool is_msix = dev_is_pci(dev) ? to_pci_dev(dev)->msix_enabled : false;
return sysfs_emit(buf, "%s\n", is_msix ? "msix" : "msi");
}