PCI/P2PDMA: Ignore root complex whitelist when an IOMMU is present
[linux-2.6-microblaze.git] / drivers / pci / p2pdma.c
index 742928d..84ba305 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/percpu-refcount.h>
 #include <linux/random.h>
 #include <linux/seq_buf.h>
+#include <linux/iommu.h>
 
 struct pci_p2pdma {
        struct percpu_ref devmap_ref;
@@ -284,6 +285,9 @@ static bool root_complex_whitelist(struct pci_dev *dev)
        struct pci_dev *root = pci_get_slot(host->bus, PCI_DEVFN(0, 0));
        unsigned short vendor, device;
 
+       if (iommu_present(dev->dev.bus))
+               return false;
+
        if (!root)
                return false;