From: Alex Williamson <alex.williamson@redhat.com>
To: linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org
Cc: bhelgaas@google.com, acooks@gmail.com, linux-kernel@vger.kernel.org
Subject: [PATCH v2 06/15] PCI: Add quirks for ASMedia and Tundra bridges
Date: Fri, 09 May 2014 09:29:01 -0600 [thread overview]
Message-ID: <20140509152901.8321.66435.stgit@bling.home> (raw)
In-Reply-To: <20140509151735.8321.22017.stgit@bling.home>
The quirk is intended to be extremely generic, but we only apply it
to known offending devices.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/pci/quirks.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 63b8245..a10a685 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3356,6 +3356,29 @@ static void quirk_dma_func1_alias(struct pci_dev *dev)
}
/*
+ * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in
+ * using the wrong DMA alias for the device. Some of these devices can be
+ * used as either forward or reverse bridges, so we need to test whether the
+ * device is operating in the correct mode. We could probably apply this
+ * quirk to PCI_ANY_ID, but for now we'll just use known offenders. The test
+ * is for a non-root, non-PCIe bridge where the upstream device is PCIe and
+ * is not a PCIe-to-PCI bridge, then @pdev is actually a PCIe-to-PCI bridge.
+ */
+static void quirk_use_pcie_bridge_dma_alias(struct pci_dev *pdev)
+{
+ if (!pci_is_root_bus(pdev->bus) &&
+ pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
+ !pci_is_pcie(pdev) && pci_is_pcie(pdev->bus->self) &&
+ pci_pcie_type(pdev->bus->self) != PCI_EXP_TYPE_PCI_BRIDGE)
+ pdev->dev_flags |= PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS;
+}
+/* ASM1083/1085, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c46 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ASMEDIA, 0x1080,
+ quirk_use_pcie_bridge_dma_alias);
+/* Tundra 8113, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c43 */
+DECLARE_PCI_FIXUP_HEADER(0x10e3, 0x8113, quirk_use_pcie_bridge_dma_alias);
+
+/*
* Marvell 88SE9123 uses function 1 as the requester ID for DMA. In some
* SKUs function 1 is present and is a legacy IDE controller, in other
* SKUs this function is not present, making this a ghost requester.
next prev parent reply other threads:[~2014-05-09 15:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 15:28 [PATCH v2 00/15] PCI/iommu: Fix DMA alias problems Alex Williamson
2014-05-09 15:28 ` [PATCH v2 01/15] PCI: Add DMA alias iterator Alex Williamson
2014-05-09 15:28 ` [PATCH v2 02/15] PCI: quirk pci_for_each_dma_alias() Alex Williamson
2014-05-09 15:28 ` [PATCH v2 03/15] PCI: quirk dma_func_alias for Ricoh devices Alex Williamson
2014-05-09 15:28 ` [PATCH v2 04/15] PCI: quirk dma_func_alias for Marvell devices Alex Williamson
2014-05-09 15:28 ` [PATCH v2 05/15] PCI: Quirk pci_for_each_dma_alias() for bridges Alex Williamson
2014-05-09 15:29 ` Alex Williamson [this message]
2014-05-09 15:29 ` [PATCH v2 07/15] PCI: Consolidate isolation domain code Alex Williamson
2014-05-09 15:29 ` [PATCH v2 08/15] iommu/amd: Use pci_find_dma_isolation_root() for IOMMU groups Alex Williamson
2014-05-09 15:29 ` [PATCH v2 09/15] iommu/amd: Update to use PCI DMA aliases Alex Williamson
2014-05-09 15:29 ` [PATCH v2 10/15] iommu/intel: Use pci_find_dma_isolation_root() for IOMMU groups Alex Williamson
2014-05-09 15:29 ` [PATCH v2 11/15] iommu/intel: Update to use PCI DMA aliases Alex Williamson
2014-05-09 15:29 ` [PATCH v2 12/15] iommu/fsl: Use pci_find_dma_isolation_root() for IOMMU groups Alex Williamson
2014-05-09 15:29 ` [PATCH v2 13/15] iommu: Remove pci.h Alex Williamson
2014-05-09 15:29 ` [PATCH v2 14/15] PCI: Remove pci_find_upstream_pcie_bridge() Alex Williamson
2014-05-09 15:29 ` [PATCH v2 15/15] PCI: Remove pci_get_dma_source() Alex Williamson
2014-05-14 23:40 ` [PATCH v2 00/15] PCI/iommu: Fix DMA alias problems Andrew Cooks
2014-05-15 17:43 ` Alex Williamson
2014-05-15 23:45 ` Andrew Cooks
2014-05-16 3:55 ` Alex Williamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140509152901.8321.66435.stgit@bling.home \
--to=alex.williamson@redhat.com \
--cc=acooks@gmail.com \
--cc=bhelgaas@google.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).