[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch V3 02/35] x86/pci/XEN: Use PCI device property
- To: LKML <linux-kernel@xxxxxxxxxxxxxxx>
- From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- Date: Fri, 10 Dec 2021 23:18:46 +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>
instead of fiddling with MSI descriptors.
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Juergen Gross <jgross@xxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
---
V3: Use pci_dev->msix_enabled.
---
arch/x86/pci/xen.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -399,9 +399,7 @@ static void xen_teardown_msi_irqs(struct
static void xen_pv_teardown_msi_irqs(struct pci_dev *dev)
{
- struct msi_desc *msidesc = first_pci_msi_entry(dev);
-
- if (msidesc->pci.msi_attrib.is_msix)
+ if (dev->msix_enabled)
xen_pci_frontend_disable_msix(dev);
else
xen_pci_frontend_disable_msi(dev);
@@ -417,10 +415,7 @@ static int xen_msi_domain_alloc_irqs(str
if (WARN_ON_ONCE(!dev_is_pci(dev)))
return -EINVAL;
- if (first_msi_entry(dev)->pci.msi_attrib.is_msix)
- type = PCI_CAP_ID_MSIX;
- else
- type = PCI_CAP_ID_MSI;
+ type = to_pci_dev(dev)->msix_enabled ? PCI_CAP_ID_MSIX : PCI_CAP_ID_MSI;
return xen_msi_ops.setup_msi_irqs(to_pci_dev(dev), nvec, type);
}
|