• Niklas Schnelle's avatar
    s390/pci: separate zbus creation from scanning · a50297cf
    Niklas Schnelle authored
    In the existing code the creation of the PCI bus and the scanning of
    function zero all happens in zpci_scan_bus(). This in turn requires
    functions to be enabled and their resources to be available before the
    PCI bus is even created.
    
    This not only means that functions are enabled long before they are
    actually made available to the common PCI subsystem. In case of
    functions with non-zero devfn which appeared before the function with
    devfn zero they can wait arbitrarily long in this enabled but not
    scanned state.
    
    Fix this by separating the creation of the PCI bus from scanning it and
    only prepare, that is enable and setup MMIO bus resources, functions
    just before they are scanned. As they may be scanned multiple times
    track if we already created resources in the zdev.
    Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
    Acked-by: default avatarPierre Morel <pmorel@linux.ibm.com>
    Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    a50297cf
pci.c 22.2 KB