[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch V3 04/35] genirq/msi: Use PCI device property
- To: LKML <linux-kernel@xxxxxxxxxxxxxxx>
- From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- Date: Fri, 10 Dec 2021 23:18:49 +0100 (CET)
- Cc: Bjorn Helgaas <helgaas@xxxxxxxxxx>, Marc Zygnier <maz@xxxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxxxx>, Megha Dey <megha.dey@xxxxxxxxx>, Ashok Raj <ashok.raj@xxxxxxxxx>, linux-pci@xxxxxxxxxxxxxxx, Cedric Le Goater <clg@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Arnd Bergmann <arnd@xxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Stuart Yoder <stuyoder@xxxxxxxxx>, Laurentiu Tudor <laurentiu.tudor@xxxxxxx>, Nishanth Menon <nm@xxxxxx>, Tero Kristo <kristo@xxxxxxxxxx>, Santosh Shilimkar <ssantosh@xxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Vinod Koul <vkoul@xxxxxxxxxx>, dmaengine@xxxxxxxxxxxxxxx, Mark Rutland <mark.rutland@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, Joerg Roedel <joro@xxxxxxxxxx>, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, Jassi Brar <jassisinghbrar@xxxxxxxxx>, Peter Ujfalusi <peter.ujfalusi@xxxxxxxxx>, Sinan Kaya <okaya@xxxxxxxxxx>
- Delivery-date: Fri, 10 Dec 2021 22:18:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
to determine whether this is MSI or MSIX instead of consulting MSI
descriptors.
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
V2: Use PCI device property - Jason
---
kernel/irq/msi.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
--- 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");
}
|