]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
Dom0 PCI: fix SR-IOV function dependency link problem
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 3 Jun 2009 10:22:24 +0000 (11:22 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 3 Jun 2009 10:22:24 +0000 (11:22 +0100)
PCIe Root Complex Integrated Endpoint does not implement ARI, so this
kind of endpoint uses 3-bit function number. The function dependency
link of the integrated endpoint should be calculated using the device
number field in conjunction with the value from function dependency
link register.

Normal SR-IOV endpoint always implements ARI and the function
dependency link register contains 8-bit function number (i.e. `devfn'
from software perspective).

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
drivers/pci/iov.c

index 7fafbcdf2fe1597314b842f202804c949839a751..b89257409326c463a070acbc809b078276ca7bf8 100644 (file)
@@ -366,6 +366,8 @@ found:
        iov->self = dev;
        pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap);
        pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
+       if (!dev->bus->number)  /* Root Complex Integrated Endpoint */
+               iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
 
        if (pdev)
                iov->dev = pci_dev_get(pdev);