• Ram Pai's avatar
    PCI: defer enablement of SRIOV BARS · bbef98ab
    Ram Pai authored
    All the PCI BARs of a device are enabled when the device is enabled
    using pci_enable_device().  This unnecessarily enables SRIOV BARs of the
    device.
    
    On some platforms, which do not support SRIOV as yet, the
    pci_enable_device() fails to enable the device if its SRIOV BARs are not
    allocated resources correctly.
    
    The following patch fixes the above problem. The SRIOV BARs are now
    enabled when IOV capability of the device is enabled in sriov_enable().
    
    NOTE: Note, there is subtle change in the pci_enable_device() API.  Any
    driver that depends on SRIOV BARS to be enabled in pci_enable_device()
    can fail.
    
    The patch has been touch tested on power and x86 platform.
    Tested-by: default avatarMichael Wang <wangyun@linux.vnet.ibm.com>
    Signed-off-by: default avatarRam Pai <linuxram@us.ibm.com>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    bbef98ab
pci.c 92.9 KB