OSDN Git Service

PCI: Add DMA alias iterator
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 22 May 2014 23:07:30 +0000 (17:07 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 28 May 2014 17:46:24 +0000 (11:46 -0600)
commitc25dc82899e67a32fdcfb20dd72a37fc236fde2e
tree5db0bd880c1b2fbfb3435e68b991216e2a770cf2
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5
PCI: Add DMA alias iterator

In a mixed PCI/PCI-X/PCIe topology, bridges can take ownership of
transactions, replacing the original requester ID with their own.
Sometimes we just want to know the resulting device or resulting alias;
other times we want each step in the chain.  This iterator allows either
usage.  When an endpoint is connected via an unbroken chain of PCIe
switches and root ports, it has no alias and its requester ID is visible to
the root bus.  When PCI/X get in the way, we pick up aliases for bridges.

The reason why we potentially care about each step in the path is because
of PCI-X.  PCI-X has the concept of a requester ID, but bridges may or may
not take ownership of various types of transactions.  We therefore leave it
to the consumer of this function to prune out what they don't care about
rather than attempt to flatten the alias ourselves.

Tested-by: George Spelvin <linux@horizon.com>
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>
drivers/pci/search.c
include/linux/pci.h