aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2014-05-28 16:54:00 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-05-28 17:48:03 -0400
commitcc346a4714a59d08c118e8f33fd86692d3563133 (patch)
tree104675486d80deb162579fd245f351344a47711c
parentec637fb2d4f7a7167c323dc1d22837d1270a21bc (diff)
PCI: Add function 1 DMA alias quirk for Marvell devices
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. Link: https://bugzilla.kernel.org/show_bug.cgi?id=42679 Tested-by: George Spelvin <linux@horizon.com> Tested-by: Andreas Schrägle <ajs124.ajs124@gmail.com> Tested-by: Tobias N <qemu@suppser.de> Tested-by: <daxcore@online.de> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/quirks.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index bc8ebd945612..923689f554bb 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)
3349DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe832, quirk_dma_func0_alias); 3349DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe832, quirk_dma_func0_alias);
3350DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe476, quirk_dma_func0_alias); 3350DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe476, quirk_dma_func0_alias);
3351 3351
3352static void quirk_dma_func1_alias(struct pci_dev *dev)
3353{
3354 if (PCI_FUNC(dev->devfn) != 1) {
3355 dev->dma_alias_devfn = PCI_DEVFN(PCI_SLOT(dev->devfn), 1);
3356 dev->dev_flags |= PCI_DEV_FLAGS_DMA_ALIAS_DEVFN;
3357 }
3358}
3359
3360/*
3361 * Marvell 88SE9123 uses function 1 as the requester ID for DMA. In some
3362 * SKUs function 1 is present and is a legacy IDE controller, in other
3363 * SKUs this function is not present, making this a ghost requester.
3364 * https://bugzilla.kernel.org/show_bug.cgi?id=42679
3365 */
3366DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9123,
3367 quirk_dma_func1_alias);
3368/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c14 */
3369DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9130,
3370 quirk_dma_func1_alias);
3371/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c47 + c57 */
3372DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9172,
3373 quirk_dma_func1_alias);
3374/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c59 */
3375DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x917a,
3376 quirk_dma_func1_alias);
3377/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c46 */
3378DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x91a0,
3379 quirk_dma_func1_alias);
3380/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c49 */
3381DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9230,
3382 quirk_dma_func1_alias);
3383/* https://bugs.gentoo.org/show_bug.cgi?id=497630 */
3384DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_JMICRON,
3385 PCI_DEVICE_ID_JMICRON_JMB388_ESD,
3386 quirk_dma_func1_alias);
3387
3352static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev) 3388static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev)
3353{ 3389{
3354 if (!PCI_FUNC(dev->devfn)) 3390 if (!PCI_FUNC(dev->devfn))