From: Yu Zhao Subject: [PATCH 13/15 v5] PCI: reserve bus range for the SR-IOV device Date: Tue, 21 Oct 2008 19:53:32 +0800 Message-ID: <20081021115332.GN3185@yzhao12-linux.sh.intel.com> References: <20081021114056.GA3185@yzhao12-linux.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "jbarnes@virtuousgeek.org" , "randy.dunlap@oracle.com" , "grundler@parisc-linux.org" , "achiang@hp.com" , "matthew@wil.cx" , "rdreier@cisco.com" , "greg@kroah.com" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" To: "linux-pci@vger.kernel.org" Return-path: Received: from mga09.intel.com ([134.134.136.24]:38315 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755378AbYJUMsd (ORCPT ); Tue, 21 Oct 2008 08:48:33 -0400 Content-Disposition: inline In-Reply-To: <20081021114056.GA3185@yzhao12-linux.sh.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Reserve bus range for SR-IOV at device scanning stage. Cc: Jesse Barnes Cc: Randy Dunlap Cc: Grant Grundler Cc: Alex Chiang Cc: Matthew Wilcox Cc: Roland Dreier Cc: Greg KH Signed-off-by: Yu Zhao --- drivers/pci/pci.h | 5 +++++ drivers/pci/probe.c | 3 +++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 7735d92..5206ae7 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -204,6 +204,7 @@ void pci_iov_remove_sysfs(struct pci_dev *dev); extern int pci_iov_resource_align(struct pci_dev *dev, int resno); extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type); +extern int pci_iov_bus_range(struct pci_bus *bus); #else static inline int pci_iov_init(struct pci_dev *dev) { @@ -227,6 +228,10 @@ static inline int pci_iov_resource_bar(struct pci_dev *dev, int resno, { return 0; } +extern inline int pci_iov_bus_range(struct pci_bus *bus) +{ + return 0; +} #endif /* CONFIG_PCI_IOV */ #endif /* DRIVERS_PCI_H */ diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 18ce9c0..50a1380 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1068,6 +1068,9 @@ unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus) for (devfn = 0; devfn < 0x100; devfn += 8) pci_scan_slot(bus, devfn); + /* Reserve buses for SR-IOV capability. */ + max += pci_iov_bus_range(bus); + /* * After performing arch-dependent fixup of the bus, look behind * all PCI-to-PCI bridges on this bus. -- 1.5.6.4