From: Keir Fraser Date: Wed, 3 Jun 2009 10:22:24 +0000 (+0100) Subject: Dom0 PCI: fix SR-IOV function dependency link problem X-Git-Tag: xen-3.4.2~50 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=19d5c3ba27b1c6642ab0bd43bbbcb09088d21cdb;p=legacy%2Flinux-2.6.18-xen.git Dom0 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 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 --- diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 7fafbcdf..b8925740 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -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);