linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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, eddy0596@gmail.com,
	linux@horizon.com
Subject: [PATCH v4.1 05/16] PCI: quirk dma_alias_devfn for Marvell devices
Date: Wed, 28 May 2014 14:54:00 -0600	[thread overview]
Message-ID: <20140528205242.27872.54432.stgit@bling.home> (raw)
In-Reply-To: <20140522230755.2856.19714.stgit@bling.home>

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
alias with the correct devfn.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

v4.1: minor commitlog tweak, no code chage

 drivers/pci/quirks.c |   36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index bc8ebd9..923689f 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3349,6 +3349,42 @@ 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_alias_devfn = PCI_DEVFN(PCI_SLOT(dev->devfn), 1);
+		dev->dev_flags |= PCI_DEV_FLAGS_DMA_ALIAS_DEVFN;
+	}
+}
+
+/*
+ * 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-28 20:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 23:07 [PATCH v4 00/16] PCI/iommu: Fix DMA alias problems Alex Williamson
2014-05-22 23:07 ` [PATCH v4 01/16] PCI: Add DMA alias iterator Alex Williamson
2014-05-22 23:07 ` [PATCH v4 02/16] PCI: define pci_dev_flags as bit shifts Alex Williamson
2014-05-22 23:07 ` [PATCH v4 03/16] PCI: quirk pci_for_each_dma_alias() Alex Williamson
2014-05-22 23:07 ` [PATCH v4 04/16] PCI: quirk dma_alias_devfn for Ricoh devices Alex Williamson
2014-05-22 23:07 ` [PATCH v4 05/16] PCI: quirk dma_alias_devfn for Marvell devices Alex Williamson
2014-05-23  1:29   ` George Spelvin
2014-05-28 17:55   ` Bjorn Helgaas
2014-05-28 18:04     ` Alex Williamson
2014-05-28 20:54   ` Alex Williamson [this message]
2014-05-22 23:08 ` [PATCH v4 06/16] PCI: Quirk pci_for_each_dma_alias() for bridges Alex Williamson
2014-05-28 18:00   ` Bjorn Helgaas
2014-05-28 19:09     ` Alex Williamson
2014-05-28 20:57   ` [PATCH v4.1 " Alex Williamson
2014-05-22 23:08 ` [PATCH v4 07/16] PCI: Add quirks for ASMedia and Tundra bridges Alex Williamson
2014-05-22 23:08 ` [PATCH v4 08/16] iommu: Create central IOMMU group lookup/creation interface Alex Williamson
2014-05-22 23:08 ` [PATCH v4 09/16] iommu/amd: Update to use PCI DMA aliases Alex Williamson
2014-05-22 23:08 ` [PATCH v4 10/16] iommu/amd: Use iommu_group_get_for_dev() Alex Williamson
2014-05-22 23:08 ` [PATCH v4 11/16] iommu/intel: " Alex Williamson
2014-05-22 23:08 ` [PATCH v4 12/16] iommu/intel: Update to use PCI DMA aliases Alex Williamson
2014-05-22 23:08 ` [PATCH v4 13/16] iommu/fsl: Use iommu_group_get_for_dev() for IOMMU groups Alex Williamson
2014-05-30  9:17   ` Varun Sethi
2014-05-22 23:08 ` [PATCH v4 14/16] iommu: Remove pci.h Alex Williamson
2014-05-22 23:08 ` [PATCH v4 15/16] PCI: Remove pci_find_upstream_pcie_bridge() Alex Williamson
2014-05-22 23:09 ` [PATCH v4 16/16] PCI: Remove pci_get_dma_source() Alex Williamson
2014-05-28  5:23 ` [PATCH v4 00/16] PCI/iommu: Fix DMA alias problems Pat Erley
2014-05-28 20:29 ` Bjorn Helgaas
2014-05-28 20:45   ` Alex Williamson
2014-05-30  5:30   ` Andrew Cooks
2014-06-09 18:01 ` Alex Williamson
2014-06-16 14:47 ` Joerg Roedel
2014-06-16 15:34   ` 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=20140528205242.27872.54432.stgit@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=acooks@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=eddy0596@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@horizon.com \
    /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).