]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: fix SR-IOV function dependency link problem
authorYu Zhao <yu.zhao@intel.com>
Wed, 20 May 2009 09:11:57 +0000 (17:11 +0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 11 Jun 2009 19:04:20 +0000 (12:04 -0700)
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 plus the value from function dependency link register.

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

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

index b497daab3d4a26ebf5b818bacdcf798fa9d4f9ef..e87fe95da8142be8c49888eb54c811ee0018087c 100644 (file)
@@ -487,6 +487,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->pcie_type == PCI_EXP_TYPE_RC_END)
+               iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
 
        if (pdev)
                iov->dev = pci_dev_get(pdev);