aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/quirks.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 923689f554bb..ab620aca632b 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3385,6 +3385,29 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_JMICRON,
3385 PCI_DEVICE_ID_JMICRON_JMB388_ESD, 3385 PCI_DEVICE_ID_JMICRON_JMB388_ESD,
3386 quirk_dma_func1_alias); 3386 quirk_dma_func1_alias);
3387 3387
3388/*
3389 * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in
3390 * using the wrong DMA alias for the device. Some of these devices can be
3391 * used as either forward or reverse bridges, so we need to test whether the
3392 * device is operating in the correct mode. We could probably apply this
3393 * quirk to PCI_ANY_ID, but for now we'll just use known offenders. The test
3394 * is for a non-root, non-PCIe bridge where the upstream device is PCIe and
3395 * is not a PCIe-to-PCI bridge, then @pdev is actually a PCIe-to-PCI bridge.
3396 */
3397static void quirk_use_pcie_bridge_dma_alias(struct pci_dev *pdev)
3398{
3399 if (!pci_is_root_bus(pdev->bus) &&
3400 pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
3401 !pci_is_pcie(pdev) && pci_is_pcie(pdev->bus->self) &&
3402 pci_pcie_type(pdev->bus->self) != PCI_EXP_TYPE_PCI_BRIDGE)
3403 pdev->dev_flags |= PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS;
3404}
3405/* ASM1083/1085, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c46 */
3406DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ASMEDIA, 0x1080,
3407 quirk_use_pcie_bridge_dma_alias);
3408/* Tundra 8113, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c43 */
3409DECLARE_PCI_FIXUP_HEADER(0x10e3, 0x8113, quirk_use_pcie_bridge_dma_alias);
3410
3388static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev) 3411static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev)
3389{ 3412{
3390 if (!PCI_FUNC(dev->devfn)) 3413 if (!PCI_FUNC(dev->devfn))