mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yu Zhao <yu.zhao@intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v12 1/8] PCI: initialize and release SR-IOV capability
Date: Sat, 21 Mar 2009 22:05:11 +0800	[thread overview]
Message-ID: <20090321140511.GA24964@yzhao-otc.sh.intel.com> (raw)
In-Reply-To: <20090320105409.5ed80885@hobbes.lan>

On Sat, Mar 21, 2009 at 01:54:09AM +0800, Jesse Barnes wrote:
> On Fri, 20 Mar 2009 11:25:11 +0800
> Yu Zhao <yu.zhao@intel.com> wrote:
> 
> > If a device has the SR-IOV capability, initialize it (set the ARI
> > Capable Hierarchy in the lowest numbered PF if necessary; calculate
> > the System Page Size for the VF MMIO, probe the VF Offset, Stride
> > and BARs). A lock for the VF bus allocation is also initialized if
> > a PF is the lowest numbered PF.
> > 
> > Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
> > Signed-off-by: Yu Zhao <yu.zhao@intel.com>
> 
> I applied this series to my linux-next branch, but there were a few
> conflicts here and there, so please check it out.  Looks like from
> start to finish this took about 6 months to get banged into shape,
> thanks for staying on it, Yu!

Yes, I checked them and found there is conflict between the SR-IOV
changes and Yinghai's 'PCI/x86: detect host bridge config space size
w/o using quirks'. Following is the fix, thanks!


New pci_cfg_space_size() needs invalid pdev->class, put it in the
right place in the pci_setup_device().

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
---
 drivers/pci/probe.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 56c71e5..e2f3dd0 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -713,7 +713,6 @@ int pci_setup_device(struct pci_dev *dev)
 	dev->dev.bus = &pci_bus_type;
 	dev->hdr_type = hdr_type & 0x7f;
 	dev->multifunction = !!(hdr_type & 0x80);
-	dev->cfg_size = pci_cfg_space_size(dev);
 	dev->error_state = pci_channel_io_normal;
 	set_pcie_port_type(dev);
 
@@ -738,6 +737,9 @@ int pci_setup_device(struct pci_dev *dev)
 	dev_dbg(&dev->dev, "found [%04x:%04x] class %06x header type %02x\n",
 		 dev->vendor, dev->device, class, dev->hdr_type);
 
+	/* need to have dev->class ready */
+	dev->cfg_size = pci_cfg_space_size(dev);
+
 	/* "Unknown power state" */
 	dev->current_state = PCI_UNKNOWN;
 
@@ -959,9 +961,6 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
 		return NULL;
 	}
 
-	/* need to have dev->class ready */
-	dev->cfg_size = pci_cfg_space_size(dev);
-
 	return dev;
 }
 
-- 
1.5.6.4


  reply	other threads:[~2009-03-21 14:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-20  3:25 [PATCH v12 0/8] PCI: Linux kernel SR-IOV support Yu Zhao
2009-03-20  3:25 ` [PATCH v12 1/8] PCI: initialize and release SR-IOV capability Yu Zhao
2009-03-20 17:54   ` Jesse Barnes
2009-03-21 14:05     ` Yu Zhao [this message]
2009-03-26 22:50       ` Jesse Barnes
2009-03-20  3:25 ` [PATCH v12 2/8] PCI: restore saved SR-IOV state Yu Zhao
2009-03-20  3:25 ` [PATCH v12 3/8] PCI: reserve bus range for SR-IOV device Yu Zhao
2009-03-20  3:25 ` [PATCH v12 4/8] PCI: centralize device setup code Yu Zhao
2009-03-20  3:25 ` [PATCH v12 5/8] PCI: add SR-IOV API for Physical Function driver Yu Zhao
2009-03-20  3:25 ` [PATCH v12 6/8] PCI: handle SR-IOV Virtual Function Migration Yu Zhao
2009-03-20  3:25 ` [PATCH v12 7/8] PCI: document SR-IOV sysfs entries Yu Zhao
2009-03-20 16:32   ` Chetan.Loke
2009-03-20  3:25 ` [PATCH v12 8/8] PCI: manual for SR-IOV user and driver developer Yu Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090321140511.GA24964@yzhao-otc.sh.intel.com \
    --to=yu.zhao@intel.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®