From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yinghai Lu Subject: [PATCH 17/22] PCI, pciehp: Remove not needed bus number range checking Date: Fri, 10 Feb 2012 20:06:20 -0800 Message-ID: <1328933185-15154-18-git-send-email-yinghai@kernel.org> References: <1328933185-15154-1-git-send-email-yinghai@kernel.org> Return-path: In-Reply-To: <1328933185-15154-1-git-send-email-yinghai@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Jesse Barnes , Benjamin Herrenschmidt , Tony Luck Cc: Bjorn Helgaas , Dominik Brodowski , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Yinghai Lu List-Id: linux-arch.vger.kernel.org Found hotplug adding one EM with bridge fail, bios only leave one bus range for slot. [ 1169.621444] pciehp: No bus number available for hot-added bridge 0000:55:00.0 [ 1169.633277] pcieport 0000:40:03.0: PCI bridge to [bus 55-55] With busn_res tracking and allocating, we don't need that checking anymore. Parent bridges' bus number will be extended safely. Signed-off-by: Yinghai Lu --- drivers/pci/hotplug/pciehp_pci.c | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index a4031df..df1f3ed 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c @@ -37,18 +37,8 @@ static int __ref pciehp_add_bridge(struct pci_dev *dev) { struct pci_bus *parent = dev->bus; - int pass, busnr, start = parent->secondary; - int end = parent->subordinate; + int pass, busnr = parent->secondary; - for (busnr = start; busnr <= end; busnr++) { - if (!pci_find_bus(pci_domain_nr(parent), busnr)) - break; - } - if (busnr-- > end) { - err("No bus number available for hot-added bridge %s\n", - pci_name(dev)); - return -1; - } for (pass = 0; pass < 2; pass++) busnr = pci_scan_bridge(parent, dev, busnr, pass); if (!dev->subordinate) -- 1.7.7 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from acsinet15.oracle.com ([141.146.126.227]:16530 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760831Ab2BKEHa (ORCPT ); Fri, 10 Feb 2012 23:07:30 -0500 From: Yinghai Lu Subject: [PATCH 17/22] PCI, pciehp: Remove not needed bus number range checking Date: Fri, 10 Feb 2012 20:06:20 -0800 Message-ID: <1328933185-15154-18-git-send-email-yinghai@kernel.org> In-Reply-To: <1328933185-15154-1-git-send-email-yinghai@kernel.org> References: <1328933185-15154-1-git-send-email-yinghai@kernel.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Jesse Barnes , Benjamin Herrenschmidt , Tony Luck Cc: Bjorn Helgaas , Dominik Brodowski , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Yinghai Lu Message-ID: <20120211040620.IZoMTqCdUPQ2ASxBvbdDHkHWRf0dg0JqoYvp4BUydDg@z> Found hotplug adding one EM with bridge fail, bios only leave one bus range for slot. [ 1169.621444] pciehp: No bus number available for hot-added bridge 0000:55:00.0 [ 1169.633277] pcieport 0000:40:03.0: PCI bridge to [bus 55-55] With busn_res tracking and allocating, we don't need that checking anymore. Parent bridges' bus number will be extended safely. Signed-off-by: Yinghai Lu --- drivers/pci/hotplug/pciehp_pci.c | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index a4031df..df1f3ed 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c @@ -37,18 +37,8 @@ static int __ref pciehp_add_bridge(struct pci_dev *dev) { struct pci_bus *parent = dev->bus; - int pass, busnr, start = parent->secondary; - int end = parent->subordinate; + int pass, busnr = parent->secondary; - for (busnr = start; busnr <= end; busnr++) { - if (!pci_find_bus(pci_domain_nr(parent), busnr)) - break; - } - if (busnr-- > end) { - err("No bus number available for hot-added bridge %s\n", - pci_name(dev)); - return -1; - } for (pass = 0; pass < 2; pass++) busnr = pci_scan_bridge(parent, dev, busnr, pass); if (!dev->subordinate) -- 1.7.7