Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411877

[RESEND PATCH v2 4/6] iommu: Set PCI_BUS_FLAGS_MSI_REMAP on iommu driver initialization

From Yongji Xie <xyjxie@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [RESEND PATCH v2 4/6] iommu: Set PCI_BUS_FLAGS_MSI_REMAP on iommu driver initialization
Date 2016-06-02 08:20 +0200
Message-ID <rFu94-2i2-35@gated-at.bofh.it> (permalink)
References <rFu94-2i2-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Some iommu drivers would be initialized after PCI device
enumeration. So PCI_BUS_FLAGS_MSI_REMAP would not be set
when probing PCI devices although IOMMU enables capability
of IRQ remapping. This patch tests this capability and
set the flag when iommu driver is initialized.

Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
---
 drivers/iommu/iommu.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index b9df141..e6159ab 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -872,6 +872,14 @@ static int add_iommu_group(struct device *dev, void *data)
 	const struct iommu_ops *ops = cb->ops;
 	int ret;
 
+	/*
+	 * Set PCI_BUS_FLAGS_MSI_REMAP for all PCI buses when IOMMU
+	 * have capability of IRQ remapping.
+	 */
+	if (dev_is_pci(dev) && ops->capable &&
+			ops->capable(IOMMU_CAP_INTR_REMAP))
+		to_pci_dev(dev)->bus->bus_flags |= PCI_BUS_FLAGS_MSI_REMAP;
+
 	if (!ops->add_device)
 		return 0;
 
-- 
1.7.9.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X table Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-06-02 08:20 +0200
  [RESEND PATCH v2 4/6] iommu: Set PCI_BUS_FLAGS_MSI_REMAP on iommu driver initialization Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-06-02 08:20 +0200
  Re: [RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X  table Alex Williamson <alex.williamson@redhat.com> - 2016-06-02 15:20 +0200
    Re: [RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X  table Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-06-03 04:30 +0200
  Re: [RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X  table Auger Eric <eric.auger@redhat.com> - 2016-06-08 09:50 +0200
    Re: [RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X  table Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-06-08 12:00 +0200

csiph-web