From: Jayachandran C <jchandra@broadcom.com>
To: Alex Williamson <alex.williamson@redhat.com>,
iommu@lists.linux-foundation.org
Cc: Jayachandran C <jchandra@broadcom.com>,
Bjorn Helgaas <helgaas@kernel.org>,
linux-pci@vger.kernel.org
Subject: [PATCH v2 2/2] PCI: Handle Broadcom Vulcan DMA alias calculation quirk
Date: Sun, 8 May 2016 15:03:21 +0530 [thread overview]
Message-ID: <1462700001-30086-2-git-send-email-jchandra@broadcom.com> (raw)
In-Reply-To: <1462700001-30086-1-git-send-email-jchandra@broadcom.com>
In-Reply-To: <linux-pci@vger.kernel.org>
The Broadcom Vulcan PCI topology is slightly unusual, for a multi-node
system, it looks like:
[bus 0]
|
+--[node 0 PCI bridge 0.0.0]
| |
| [bus 1]
| +---[SoC PCI devices 1.4.x, 1.5.x] ........
| +---[Glue bridges 1.a.x, 1.b.x] \
| | .....{node 0 GIC ITS}
| | /
| +----[SoC PCIe controller root ports]
| | \...... {SMMUv3 0..3}
| |
| +---- [external PCI devices]
+- [node 1 PCI bridge 0.0.1]
| |
| [bus n - similar to bus 1 above]
...
The for_each_dma_alias call for external PCI devices should not go
beyond the PCIe controllers where the SMMU and ITS is associated, going
further above to the glue bridges or the node bridges will find aliases
which are not valid. For internal devices, the association is at the
node level bridge and the alias search should not go further.
To handle this quirk, we mark the SoC PCIe bridges and node PCI bridge
with flag PCI_DEV_FLAGS_DMA_ALIAS_ROOT so that the alias and RID
calculations are correct.
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
drivers/pci/quirks.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 8e67802..62664b5 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3734,6 +3734,20 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias);
DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias);
/*
+ * The IOMMU and interrupt controller of Broadcom vulcan are associated
+ * not at the root bus, but at a bridge below. The DMA alias search should
+ * not go above the bridge at which the association exists.
+ */
+static void quirk_bridge_brcm_vulcan_pcie_root(struct pci_dev *pdev)
+{
+ pdev->dev_flags |= PCI_DEV_FLAGS_DMA_ALIAS_ROOT;
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
+ quirk_bridge_brcm_vulcan_pcie_root);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
+ quirk_bridge_brcm_vulcan_pcie_root);
+
+/*
* Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
* class code. Fix it.
*/
--
1.9.1
next prev parent reply other threads:[~2016-05-08 9:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 9:33 [PATCH v2 1/2] PCI: Add PCI device flag PCI_DEV_FLAGS_DMA_ALIAS_ROOT Jayachandran C
2016-05-08 9:33 ` Jayachandran C [this message]
2016-06-11 17:24 ` [PATCH v2 2/2] PCI: Handle Broadcom Vulcan DMA alias calculation quirk Bjorn Helgaas
2016-06-14 16:10 ` Jayachandran C
2016-05-09 10:10 ` [PATCH v2 1/2] PCI: Add PCI device flag PCI_DEV_FLAGS_DMA_ALIAS_ROOT Robin Murphy
2016-05-11 6:28 ` Jayachandran C
2016-05-11 14:26 ` Robin Murphy
2016-05-17 11:55 ` Jayachandran C
2016-06-23 5:01 ` Jon Masters
2016-06-23 12:04 ` Robin Murphy
2016-06-23 13:19 ` Jon Masters
2016-06-24 3:37 ` Bjorn Helgaas
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=1462700001-30086-2-git-send-email-jchandra@broadcom.com \
--to=jchandra@broadcom.com \
--cc=alex.williamson@redhat.com \
--cc=helgaas@kernel.org \
--cc=iommu@lists.linux-foundation.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).