From 19d5c3ba27b1c6642ab0bd43bbbcb09088d21cdb Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 3 Jun 2009 11:22:24 +0100 Subject: [PATCH] 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 --- drivers/pci/iov.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.39.5