• P
    [PATCH] PCI: Add pci_walk_bus function to PCI core (nonrecursive) · cecf4864
    Paul Mackerras 提交于
    The PCI error recovery infrastructure needs to be able to contact all
    the drivers affected by a PCI error event, which may mean traversing
    all the devices under a given PCI-PCI bridge.  This patch adds a
    function to the PCI core that traverses all the PCI devices on a PCI
    bus and under any PCI-PCI bridges on that bus (and so on), calling a
    given function for each device.  This provides a way for the error
    recovery code to iterate through all devices that are affected by an
    error event.
    
    This version is not implemented as a recursive function.  Instead,
    when we reach a PCI-PCI bridge, we set the pointers to start doing the
    devices on the bus under the bridge, and when we reach the end of a
    bus's devices, we use the bus->self pointer to go back up to the next
    higher bus and continue doing its devices.
    Signed-off-by: NPaul Mackerras <paulus@samba.org>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    cecf4864
bus.c 5.2 KB