diff options
author | Yu Zhao <yu.zhao@intel.com> | 2009-05-20 05:11:57 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-11 15:04:20 -0400 |
commit | 4d135dbee7b0a89e946f7ba284f2b957505a2c3a (patch) | |
tree | 332fb82ad8721cd1c3b8f0260971b2389f76ad5a /drivers/pci/iov.c | |
parent | af4c5f985afd8d4cfdf402aaa03677f2cb96e37c (diff) |
PCI: fix SR-IOV function dependency link problem
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>
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r-- | drivers/pci/iov.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index b497daab3d4a..e87fe95da814 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
@@ -487,6 +487,8 @@ found: | |||
487 | iov->self = dev; | 487 | iov->self = dev; |
488 | pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap); | 488 | pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap); |
489 | pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link); | 489 | pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link); |
490 | if (dev->pcie_type == PCI_EXP_TYPE_RC_END) | ||
491 | iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link); | ||
490 | 492 | ||
491 | if (pdev) | 493 | if (pdev) |
492 | iov->dev = pci_dev_get(pdev); | 494 | iov->dev = pci_dev_get(pdev); |