]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: defer enablement of SRIOV BARS
authorRam Pai <linuxram@us.ibm.com>
Sun, 6 Nov 2011 02:33:10 +0000 (10:33 +0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 5 Dec 2011 18:30:22 +0000 (10:30 -0800)
commit3dddda4316760bfbcc45f45af1a832ae7ec295a2
tree07123873f64c4a61fef7c98a4744d4cad852c345
parent8674c426463920dd9c52b1e8cf3f2a9b5553023a
PCI: defer enablement of SRIOV BARS

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: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/iov.c
drivers/pci/pci.c