• Gavin Shan's avatar
    PCI: Do any VF BAR updates before enabling the BARs · f40ec3c7
    Gavin Shan authored
    Previously we enabled VFs and enable their memory space before calling
    pcibios_sriov_enable().  But pcibios_sriov_enable() may update the VF BARs:
    for example, on PPC PowerNV we may change them to manage the association of
    VFs to PEs.
    
    Because 64-bit BARs cannot be updated atomically, it's unsafe to update
    them while they're enabled.  The half-updated state may conflict with other
    devices in the system.
    
    Call pcibios_sriov_enable() before enabling the VFs so any BAR updates
    happen while the VF BARs are disabled.
    
    [bhelgaas: changelog]
    Tested-by: default avatarCarol Soto <clsoto@us.ibm.com>
    Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    f40ec3c7
iov.c 17.6 KB