aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2014-09-17 12:41:13 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-09-22 16:48:32 -0400
commit5d8f4c9fdd67404c9f94683836e49ec8bded2287 (patch)
treeb9d415aac6a326e481ff62270a3fe2fb6b7137c5 /drivers/pci/quirks.c
parentbee3f304435a9c8c70b135083e23516872a17c98 (diff)
PCI: Remove unused pci_get_dma_source()
pci_get_dma_source() is unused, so remove it. We now have dma_alias_devfn() to describe this. 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.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index da062d8ae36f..01c935cc38dc 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3514,57 +3514,6 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias);
3514/* Intel 82801, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c49 */ 3514/* Intel 82801, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c49 */
3515DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias); 3515DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias);
3516 3516
3517static struct pci_dev *pci_func_0_dma_source(struct pci_dev *dev)
3518{
3519 if (!PCI_FUNC(dev->devfn))
3520 return pci_dev_get(dev);
3521
3522 return pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
3523}
3524
3525static const struct pci_dev_dma_source {
3526 u16 vendor;
3527 u16 device;
3528 struct pci_dev *(*dma_source)(struct pci_dev *dev);
3529} pci_dev_dma_source[] = {
3530 /*
3531 * https://bugzilla.redhat.com/show_bug.cgi?id=605888
3532 *
3533 * Some Ricoh devices use the function 0 source ID for DMA on
3534 * other functions of a multifunction device. The DMA devices
3535 * is therefore function 0, which will have implications of the
3536 * iommu grouping of these devices.
3537 */
3538 { PCI_VENDOR_ID_RICOH, 0xe822, pci_func_0_dma_source },
3539 { PCI_VENDOR_ID_RICOH, 0xe230, pci_func_0_dma_source },
3540 { PCI_VENDOR_ID_RICOH, 0xe832, pci_func_0_dma_source },
3541 { PCI_VENDOR_ID_RICOH, 0xe476, pci_func_0_dma_source },
3542 { 0 }
3543};
3544
3545/*
3546 * IOMMUs with isolation capabilities need to be programmed with the
3547 * correct source ID of a device. In most cases, the source ID matches
3548 * the device doing the DMA, but sometimes hardware is broken and will
3549 * tag the DMA as being sourced from a different device. This function
3550 * allows that translation. Note that the reference count of the
3551 * returned device is incremented on all paths.
3552 */
3553struct pci_dev *pci_get_dma_source(struct pci_dev *dev)
3554{
3555 const struct pci_dev_dma_source *i;
3556
3557 for (i = pci_dev_dma_source; i->dma_source; i++) {
3558 if ((i->vendor == dev->vendor ||
3559 i->vendor == (u16)PCI_ANY_ID) &&
3560 (i->device == dev->device ||
3561 i->device == (u16)PCI_ANY_ID))
3562 return i->dma_source(dev);
3563 }
3564
3565 return pci_dev_get(dev);
3566}
3567
3568/* 3517/*
3569 * AMD has indicated that the devices below do not support peer-to-peer 3518 * AMD has indicated that the devices below do not support peer-to-peer
3570 * in any system where they are found in the southbridge with an AMD 3519 * in any system where they are found in the southbridge with an AMD