diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2014-05-28 16:57:02 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-05-28 17:52:52 -0400 |
commit | c8fe16e3f96a9bb95a10cedb19d2be2d2d580940 (patch) | |
tree | 56df91477693c6098939afdce0a75e7c604ee732 | |
parent | cc346a4714a59d08c118e8f33fd86692d3563133 (diff) |
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>
-rw-r--r-- | drivers/pci/search.c | 10 | ||||
-rw-r--r-- | include/linux/pci.h | 2 |
2 files changed, 10 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, | |||
88 | continue; | 88 | continue; |
89 | } | 89 | } |
90 | } else { | 90 | } else { |
91 | ret = fn(tmp, PCI_DEVID(tmp->bus->number, tmp->devfn), | 91 | if (tmp->dev_flags & PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS) |
92 | data); | 92 | ret = fn(tmp, |
93 | PCI_DEVID(tmp->subordinate->number, | ||
94 | PCI_DEVFN(0, 0)), data); | ||
95 | else | ||
96 | ret = fn(tmp, | ||
97 | PCI_DEVID(tmp->bus->number, | ||
98 | tmp->devfn), data); | ||
93 | if (ret) | 99 | if (ret) |
94 | return ret; | 100 | return ret; |
95 | } | 101 | } |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 9d4035c276f4..85ab35e974a9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -173,6 +173,8 @@ enum pci_dev_flags { | |||
173 | PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) (1 << 3), | 173 | PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) (1 << 3), |
174 | /* Flag to indicate the device uses dma_alias_devfn */ | 174 | /* Flag to indicate the device uses dma_alias_devfn */ |
175 | PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), | 175 | PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), |
176 | /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */ | ||
177 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), | ||
176 | }; | 178 | }; |
177 | 179 | ||
178 | enum pci_irq_reroute_variant { | 180 | enum pci_irq_reroute_variant { |