summaryrefslogtreecommitdiffstats
path: root/drivers/pci/search.c
diff options
context:
space:
mode:
authorAlex Williamson2014-05-28 22:57:02 +0200
committerBjorn Helgaas2014-05-28 23:52:52 +0200
commitc8fe16e3f96a9bb95a10cedb19d2be2d2d580940 (patch)
tree56df91477693c6098939afdce0a75e7c604ee732 /drivers/pci/search.c
parentPCI: Add function 1 DMA alias quirk for Marvell devices (diff)
downloadkernel-qcow2-linux-c8fe16e3f96a9bb95a10cedb19d2be2d2d580940.tar.gz
kernel-qcow2-linux-c8fe16e3f96a9bb95a10cedb19d2be2d2d580940.tar.xz
kernel-qcow2-linux-c8fe16e3f96a9bb95a10cedb19d2be2d2d580940.zip
PCI: Add support for PCIe-to-PCI bridge DMA alias quirks
Several PCIe-to-PCI bridges fail to provide a PCIe capability, causing us to handle them as conventional PCI devices when they really use the requester ID of the secondary bus. We need to differentiate these from PCIe-to-PCI bridges that actually use the conventional PCI ID when a PCIe capability is not present, such as those found on the root complex of may Intel chipsets. Add a dev_flag bit to identify devices to be handled as standard PCIe-to-PCI bridges. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/search.c')
-rw-r--r--drivers/pci/search.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 2c19f3f40621..df38f73f091f 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -88,8 +88,14 @@ int pci_for_each_dma_alias(struct pci_dev *pdev,
continue;
}
} else {
- ret = fn(tmp, PCI_DEVID(tmp->bus->number, tmp->devfn),
- data);
+ if (tmp->dev_flags & PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS)
+ ret = fn(tmp,
+ PCI_DEVID(tmp->subordinate->number,
+ PCI_DEVFN(0, 0)), data);
+ else
+ ret = fn(tmp,
+ PCI_DEVID(tmp->bus->number,
+ tmp->devfn), data);
if (ret)
return ret;
}