• Gavin Shan's avatar
    powerpc/pci: Save P2P bridge resource if possible · cf1a4cf8
    Gavin Shan authored
    When PCI probe flag PCI_REASSIGN_ALL_RSRC has been passed into PCI
    core, it's hoped that all resources to be reassigned by PCI core.
    As to particular P2P (PCI-to-PCI) bridge, the size of the corresponding
    BAR (I/O, MMIO, prefetchable MMIO) is calculated by the resources
    required by the PCI devices behind the P2P bridge. That means that
    the information like start/end address retrieved from the hardware
    registers of the P2P bridge is meainingless in the case. However,
    we still count that in and the BARs might have been configured by
    firmware with non-zero size. That leads to space waste.
    
    The patch explicitly sets the size of P2P bridge BARs to zero in
    case that resource reassignment is expected with PCI probe flag
    PCI_REASSIGN_ALL_RSRC. In the result, it will save overall resource
    required by the system without waste.
    Signed-off-by: default avatarGavin Shan <shangw@linux.vnet.ibm.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    cf1a4cf8
pci-common.c 48.2 KB