iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-gpGsJRJZ3PBBDgjK7y7TUQ@public.gmane.org
Subject: [PATCH v3 04/15] PCI: quirk dma_func_alias for Marvell devices
Date: Sat, 10 May 2014 09:02:47 -0600	[thread overview]
Message-ID: <20140510150247.2997.91416.stgit@bling.home> (raw)
In-Reply-To: <20140510145619.2997.429.stgit-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>

Several Marvell devices and a JMicron device have a similar DMA
requester ID problem to Ricoh, except they use function 1 as the
PCIe requester ID.  Add a quirk for these to populate the DMA
function alias bitmap.

Signed-off-by: Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 drivers/pci/quirks.c |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ea2cb9f..c6ae46f 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3347,6 +3347,40 @@ static void quirk_dma_func0_alias(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe832, quirk_dma_func0_alias);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe476, quirk_dma_func0_alias);
 
+static void quirk_dma_func1_alias(struct pci_dev *dev)
+{
+	if (PCI_FUNC(dev->devfn) != 1)
+		dev->dma_func_alias |= (1 << 1);
+}
+
+/*
+ * 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.
+ * https://bugzilla.kernel.org/show_bug.cgi?id=42679
+ */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9123,
+			 quirk_dma_func1_alias);
+/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c14 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9130,
+			 quirk_dma_func1_alias);
+/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c47 + c57 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9172,
+			 quirk_dma_func1_alias);
+/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c59 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x917a,
+			 quirk_dma_func1_alias);
+/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c46 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x91a0,
+			 quirk_dma_func1_alias);
+/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c49 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9230,
+			 quirk_dma_func1_alias);
+/* https://bugs.gentoo.org/show_bug.cgi?id=497630 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_JMICRON,
+			 PCI_DEVICE_ID_JMICRON_JMB388_ESD,
+			 quirk_dma_func1_alias);
+
 static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev)
 {
 	if (!PCI_FUNC(dev->devfn))

  parent reply	other threads:[~2014-05-10 15:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-10 15:02 [PATCH v3 00/15] PCI/iommu: Fix DMA alias problems Alex Williamson
     [not found] ` <20140510145619.2997.429.stgit-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2014-05-10 15:02   ` [PATCH v3 01/15] PCI: Add DMA alias iterator Alex Williamson
2014-05-10 15:02   ` [PATCH v3 02/15] PCI: quirk pci_for_each_dma_alias() Alex Williamson
2014-05-10 15:02   ` [PATCH v3 03/15] PCI: quirk dma_func_alias for Ricoh devices Alex Williamson
2014-05-10 15:02   ` Alex Williamson [this message]
2014-05-10 15:02   ` [PATCH v3 05/15] PCI: Quirk pci_for_each_dma_alias() for bridges Alex Williamson
2014-05-10 15:02   ` [PATCH v3 06/15] PCI: Add quirks for ASMedia and Tundra bridges Alex Williamson
2014-05-10 15:03   ` [PATCH v3 07/15] PCI: Consolidate isolation domain code Alex Williamson
2014-05-10 15:03   ` [PATCH v3 08/15] iommu/amd: Use pci_find_dma_isolation_root() for IOMMU groups Alex Williamson
2014-05-14 10:34     ` Joerg Roedel
     [not found]       ` <20140514103449.GE6026-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2014-05-14 14:27         ` Alex Williamson
2014-05-10 15:03   ` [PATCH v3 09/15] iommu/amd: Update to use PCI DMA aliases Alex Williamson
2014-05-10 15:03   ` [PATCH v3 10/15] iommu/intel: Use pci_find_dma_isolation_root() for IOMMU groups Alex Williamson
2014-05-10 15:03   ` [PATCH v3 11/15] iommu/intel: Update to use PCI DMA aliases Alex Williamson
2014-05-10 15:03   ` [PATCH v3 12/15] iommu/fsl: Use pci_find_dma_isolation_root() for IOMMU groups Alex Williamson
2014-05-10 15:03   ` [PATCH v3 13/15] iommu: Remove pci.h Alex Williamson
2014-05-10 15:03   ` [PATCH v3 14/15] PCI: Remove pci_find_upstream_pcie_bridge() Alex Williamson
2014-05-10 15:03   ` [PATCH v3 15/15] PCI: Remove pci_get_dma_source() Alex Williamson
2014-05-10 16:51   ` [PATCH v3 00/15] PCI/iommu: Fix DMA alias problems George Spelvin
     [not found] ` <1400020520427-859747.post@n7.nabble.com>
     [not found]   ` <1400020520427-859747.post-hbTxXoYVu7Vl57MIdRCFDg@public.gmane.org>
2014-05-14 17:18     ` 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=20140510150247.2997.91416.stgit@bling.home \
    --to=alex.williamson-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-gpGsJRJZ3PBBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).