• Alex Williamson's avatar
    PCI: add PCI DMA source ID quirk · 12ea6cad
    Alex Williamson authored
    DMA transactions are tagged with the source ID of the device making
    the request.  Occasionally hardware screws this up and uses the
    source ID of a different device (often the wrong function number of
    a multifunction device).  A specific Ricoh multifunction device is
    a prime example of this problem and included in this patch.
    
    Given a pci_dev, this function returns the pci_dev to use as the
    source ID for DMA.  When hardware works correctly, this returns
    the input device.  For the components of the Ricoh multifunction
    device, it returns the pci_dev for function 0.
    
    This will be used by IOMMU drivers for determining the boundaries
    of IOMMU groups as multiple devices using the same source ID must
    be contained within the same group.  This can also be used by
    existing streaming DMA paths for the same purpose.
    
    [bhelgaas: fold in pci_dev_get() for !CONFIG_PCI]
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    12ea6cad
quirks.c 111 KB