From patchwork Sat Apr 18 17:11:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 18828 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3IHC5M4012151 for ; Sat, 18 Apr 2009 17:12:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753988AbZDRRMF (ORCPT ); Sat, 18 Apr 2009 13:12:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753915AbZDRRME (ORCPT ); Sat, 18 Apr 2009 13:12:04 -0400 Received: from hera.kernel.org ([140.211.167.34]:49678 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733AbZDRRMC (ORCPT ); Sat, 18 Apr 2009 13:12:02 -0400 Received: from [192.168.101.7] (adsl-75-61-233-163.dsl.pltn13.sbcglobal.net [75.61.233.163]) (authenticated bits=0) by hera.kernel.org (8.14.2/8.13.8) with ESMTP id n3IHBXMV024809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Apr 2009 17:11:34 GMT Message-ID: <49EA09BD.7070806@kernel.org> Date: Sat, 18 Apr 2009 10:11:25 -0700 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Matthew Wilcox CC: Ingo Molnar , Jesse Barnes , linux-pci@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH] Move set_pci_bus_resources_arch_default into arch/x86 References: <20090416193110.GF1926@parisc-linux.org> <20090417001248.GA29630@elte.hu> <49E8F3B9.4030100@sun.com> <20090417213855.GL1926@parisc-linux.org> <49E8F893.8090002@sun.com> <20090418003333.GM1926@parisc-linux.org> <49E987B2.1050008@kernel.org> <20090418125225.GO1926@parisc-linux.org> In-Reply-To: <20090418125225.GO1926@parisc-linux.org> X-Virus-Scanned: ClamAV 0.93.3/9255/Sat Apr 18 12:31:15 2009 on hera.kernel.org X-Virus-Status: Clean Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Matthew Wilcox wrote: > On Sat, Apr 18, 2009 at 12:56:34AM -0700, Yinghai Lu wrote: >> 1. put the calling in pci_create_bus, archs other than x86 will have >> blank weak function >> 2. if put that calling in pci_scan_child_bus, will make every child bus >> do that checking on x86 platform. >> >> other arch does not gain anything in final result > > Having x86 do its PCI fixups somewhere different from every other arch is > confusing. I know this because it confused me. This isn't about saving > a couple of hundred cycles at boot time, it's about maintainability. > ok, I withdraw the nacked-by. Jesse, please apply following patch too. [PATCH] x86/pci: x86_pci_root_bus_res_quirks 1. change the name to x86_pci_root_bus_res_quirks from set_pci_bus_resources_arch_default 2. move that weak function from common.c to i386.c aka can not put that in same function with calling function 3. before calling that check if it is root bus in pcibios_fixup_bus [mpact: fix link and clean up] Signed-off-by: Yinghai Lu Reviewed-by: Matthew Wilcox --- arch/x86/include/asm/topology.h | 2 +- arch/x86/pci/amd_bus.c | 2 +- arch/x86/pci/common.c | 8 +++----- arch/x86/pci/i386.c | 4 ++++ 4 files changed, 9 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/arch/x86/include/asm/topology.h =================================================================== --- linux-2.6.orig/arch/x86/include/asm/topology.h +++ linux-2.6/arch/x86/include/asm/topology.h @@ -200,7 +200,7 @@ static inline void arch_fix_phys_package } struct pci_bus; -void set_pci_bus_resources_arch_default(struct pci_bus *b); +void x86_pci_root_bus_res_quirks(struct pci_bus *b); #ifdef CONFIG_SMP #define mc_capable() (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids) Index: linux-2.6/arch/x86/pci/amd_bus.c =================================================================== --- linux-2.6.orig/arch/x86/pci/amd_bus.c +++ linux-2.6/arch/x86/pci/amd_bus.c @@ -94,7 +94,7 @@ struct pci_root_info { static int pci_root_num; static struct pci_root_info pci_root_info[PCI_ROOT_NR]; -void set_pci_bus_resources_arch_default(struct pci_bus *b) +void x86_pci_root_bus_res_quirks(struct pci_bus *b) { int i; int j; Index: linux-2.6/arch/x86/pci/common.c =================================================================== --- linux-2.6.orig/arch/x86/pci/common.c +++ linux-2.6/arch/x86/pci/common.c @@ -142,10 +142,6 @@ static void __devinit pcibios_fixup_devi } } -void __attribute__((weak)) set_pci_bus_resources_arch_default(struct pci_bus *b) -{ -} - /* * Called after each bus is probed, but before its children * are examined. @@ -155,7 +151,9 @@ void __devinit pcibios_fixup_bus(struct { struct pci_dev *dev; - set_pci_bus_resources_arch_default(b); + /* root bus? */ + if (!b->parent) + x86_pci_root_bus_res_quirks(b); pci_read_bridge_bases(b); list_for_each_entry(dev, &b->devices, bus_list) pcibios_fixup_device_resources(dev); Index: linux-2.6/arch/x86/pci/i386.c =================================================================== --- linux-2.6.orig/arch/x86/pci/i386.c +++ linux-2.6/arch/x86/pci/i386.c @@ -238,6 +238,10 @@ void __init pcibios_resource_survey(void */ fs_initcall(pcibios_assign_resources); +void __weak x86_pci_root_bus_res_quirks(struct pci_bus *b) +{ +} + /* * If we set up a device for bus mastering, we need to check the latency * timer as certain crappy BIOSes forget to set it properly.