Commit 0bcfade9 authored by Thomas Gleixner's avatar Thomas Gleixner

x86/pci/XEN: Use PCI device property

instead of fiddling with MSI descriptors.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20211210221813.311410967@linutronix.de
parent c7ecb95c
...@@ -399,9 +399,7 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev) ...@@ -399,9 +399,7 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev)
static void xen_pv_teardown_msi_irqs(struct pci_dev *dev) static void xen_pv_teardown_msi_irqs(struct pci_dev *dev)
{ {
struct msi_desc *msidesc = first_pci_msi_entry(dev); if (dev->msix_enabled)
if (msidesc->pci.msi_attrib.is_msix)
xen_pci_frontend_disable_msix(dev); xen_pci_frontend_disable_msix(dev);
else else
xen_pci_frontend_disable_msi(dev); xen_pci_frontend_disable_msi(dev);
...@@ -417,10 +415,7 @@ static int xen_msi_domain_alloc_irqs(struct irq_domain *domain, ...@@ -417,10 +415,7 @@ static int xen_msi_domain_alloc_irqs(struct irq_domain *domain,
if (WARN_ON_ONCE(!dev_is_pci(dev))) if (WARN_ON_ONCE(!dev_is_pci(dev)))
return -EINVAL; return -EINVAL;
if (first_msi_entry(dev)->pci.msi_attrib.is_msix) type = to_pci_dev(dev)->msix_enabled ? PCI_CAP_ID_MSIX : PCI_CAP_ID_MSI;
type = PCI_CAP_ID_MSIX;
else
type = PCI_CAP_ID_MSI;
return xen_msi_ops.setup_msi_irqs(to_pci_dev(dev), nvec, type); return xen_msi_ops.setup_msi_irqs(to_pci_dev(dev), nvec, type);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment