aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2014-05-22 19:07:49 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-05-28 17:20:45 -0400
commitec637fb2d4f7a7167c323dc1d22837d1270a21bc (patch)
treec8c30293f6674351b9b9b53adac763fbc673ff7d /drivers/pci/quirks.c
parent31c2b8153c58f11ddb80dfd392c16f13c2d709c6 (diff)
PCI: Add function 0 DMA alias quirk for Ricoh devices
The existing quirk for these devices (pci_get_dma_source()) doesn't really solve the problem; re-implement it using the DMA alias iterator. We'll come back later and remove the existing quirk and dma_source interface. Note that device ID 0xe822 is typically function 0 and 0xe230 has been tested to not need the quirk and are therefore removed versus the equivalent dma_source quirk. If there exist in other configurations we can re-add them. Link: https://bugzilla.redhat.com/show_bug.cgi?id=605888 Tested-by: Pat Erley <pat-lkml@erley.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e7292065a1b1..bc8ebd945612 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3333,6 +3333,22 @@ int pci_dev_specific_reset(struct pci_dev *dev, int probe)
3333 return -ENOTTY; 3333 return -ENOTTY;
3334} 3334}
3335 3335
3336static void quirk_dma_func0_alias(struct pci_dev *dev)
3337{
3338 if (PCI_FUNC(dev->devfn) != 0) {
3339 dev->dma_alias_devfn = PCI_DEVFN(PCI_SLOT(dev->devfn), 0);
3340 dev->dev_flags |= PCI_DEV_FLAGS_DMA_ALIAS_DEVFN;
3341 }
3342}
3343
3344/*
3345 * https://bugzilla.redhat.com/show_bug.cgi?id=605888
3346 *
3347 * Some Ricoh devices use function 0 as the PCIe requester ID for DMA.
3348 */
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);
3351
3336static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev) 3352static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev)
3337{ 3353{
3338 if (!PCI_FUNC(dev->devfn)) 3354 if (!PCI_FUNC(dev->devfn))