From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu Zhao Subject: [PATCH] Dom0 PCI: fix SR-IOV function dependency link problem Date: Wed, 03 Jun 2009 13:41:34 +0800 Message-ID: <4A260D0E.1010703@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080307010808010902060802" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: keir.fraser@eu.citrix.com Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------080307010808010902060802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------080307010808010902060802 Content-Type: text/x-patch; name="01.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="01.patch" # HG changeset patch # User Yu Zhao # Date 1244007161 -28800 # Node ID 3a959a6975152b741389d2eed1823d55be4f2889 # Parent ec3442c2ed48eb11fcacd3fe31af48932f0a6645 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 -r ec3442c2ed48 -r 3a959a697515 drivers/pci/iov.c --- a/drivers/pci/iov.c Wed Jun 03 13:30:08 2009 +0800 +++ b/drivers/pci/iov.c Wed Jun 03 13:32:41 2009 +0800 @@ -366,6 +366,8 @@ 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); --------------080307010808010902060802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------080307010808010902060802--