From patchwork Sat Jan 9 06:05:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 7991891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C99819F1CC for ; Sat, 9 Jan 2016 06:07:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6B8C20122 for ; Sat, 9 Jan 2016 06:07:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D61E20117 for ; Sat, 9 Jan 2016 06:07:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHmel-0003KM-Kh; Sat, 09 Jan 2016 06:05:43 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHmei-0003IQ-5R for linux-arm-kernel@lists.infradead.org; Sat, 09 Jan 2016 06:05:41 +0000 Received: by mail-wm0-x22f.google.com with SMTP id f206so158457201wmf.0 for ; Fri, 08 Jan 2016 22:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=O704xIVHwyKa0C9p7goDyalq96ljFGNMlnfgbXk7EVs=; b=CuyZcOS+ccG+tK1dxmszxisAl25/k+GljLSLHaeix5piM6bTjOJnZr139aNFetgaYi vh+Bjrkz4keNCQiGR4FPs2qU8PwFgi00ECqjVN/3aEfbIayfWS0aStsKq2p+n/i/qag7 L8CXgOGQCOIMN/ShWvHfi+OVwBHkXvV7gNsz7MgnFXU6bH/Du4q3jbFIXtMoGv16O+Zw 8pXNd0K0tY0YdqtvGObxFwo8TDRa0C8Uw1x4hbBVHmvjIEJCNBhqy+gkwjS03Rq664FM xtCJuA1goaYtuUAxfrb8blFgo5EF3CWO3hEkcUZvKh11fm2om6W6FWPvqHlPMAltoXGY WCjA== MIME-Version: 1.0 X-Received: by 10.194.80.65 with SMTP id p1mr97876488wjx.152.1452319517994; Fri, 08 Jan 2016 22:05:17 -0800 (PST) Received: by 10.27.10.26 with HTTP; Fri, 8 Jan 2016 22:05:17 -0800 (PST) In-Reply-To: <20160108180638.GF11228@arm.com> References: <1450780730-13667-1-git-send-email-gkulkarni@caviumnetworks.com> <20160108180131.GB5354@localhost> <20160108180638.GF11228@arm.com> Date: Sat, 9 Jan 2016 11:35:17 +0530 Message-ID: Subject: Re: [PATCH] arm64, pci, numa: Adding helper functions as required by pci From: Ganapatrao Kulkarni To: Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160108_220540_379295_2FFE40C2 X-CRM114-Status: GOOD ( 16.55 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Prasun Kapoor , linux-pci@vger.kernel.org, "linux-kernel@vger.kernel.org" , Robert Richter , Bjorn Helgaas , Hanjun Guo , Catalin Marinas , Bjorn Helgaas , Ganapatrao Kulkarni , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jan 8, 2016 at 11:36 PM, Will Deacon wrote: > On Fri, Jan 08, 2016 at 12:01:31PM -0600, Bjorn Helgaas wrote: >> On Tue, Dec 22, 2015 at 04:08:50PM +0530, Ganapatrao Kulkarni wrote: >> > Adding helper functions and necessary code to make >> > pci driver(pci-host-generic) numa aware. >> > >> > This patch is on top of arm64-numa v7. >> > http://www.spinics.net/lists/arm-kernel/msg460813.html >> > >> > Signed-off-by: Ganapatrao Kulkarni >> > --- >> > arch/arm64/include/asm/numa.h | 8 +++++--- >> > arch/arm64/kernel/pci.c | 8 ++++++++ >> > drivers/pci/host/pci-host-generic.c | 1 + >> > 3 files changed, 14 insertions(+), 3 deletions(-) >> > >> > diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h >> > index b8c2a3f..1eca4db 100644 >> > --- a/arch/arm64/include/asm/numa.h >> > +++ b/arch/arm64/include/asm/numa.h >> > @@ -15,9 +15,11 @@ >> > extern int __node_distance(int from, int to); >> > #define node_distance(a, b) __node_distance(a, b) >> > >> > -/* dummy definitions for pci functions */ >> > -#define pcibus_to_node(node) 0 >> > -#define cpumask_of_pcibus(bus) 0 >> > +struct pci_bus; >> > +extern int pcibus_to_node(struct pci_bus *bus); >> > +#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ >> > + cpu_all_mask : \ >> > + cpumask_of_node(pcibus_to_node(bus))) >> >> All the arch definitions of cpumask_of_pcibus() are pretty similar; >> could they be made more generic? At the very least, can you drop the >> definition here and use the one in include/asm-generic/topology.h, >> which is identical to what you're defining here? macro cpumask_of_pcibus is defined under #ifndef CONFIG_NUMA in include/asm-generic/topology.h and this macro is defined again for NUMA in respective arch header files. i think moving this macro from ifndef will allow us to use without redefinition. i have got below compilation error withour macro defined in arch code. drivers/pci/pci-sysfs.c: In function ‘cpuaffinity_show’: drivers/pci/pci-sysfs.c:114:15: error: implicit declaration of function ‘cpumask_of_pcibus’ [-Werror=implicit-function-declaration] drivers/pci/pci-sysfs.c:114:34: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/pci/pci-sysfs.c: In function ‘cpulistaffinity_show’: drivers/pci/pci-sysfs.c:123:34: warning: initialization makes pointer from integer without a cast [enabled by default] cc1: some warnings being treated as errors i can send this as separate patch( as a fix patch). > > +1 on that. I asked for exactly the same thing in my review of v7: > > http://www.spinics.net/lists/arm-kernel/msg469592.html > > but it looks like I was just ignored. > > Will thanks ganapat --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -54,14 +54,14 @@ #define pcibus_to_node(bus) ((void)(bus), -1) #endif +#endif /* CONFIG_NUMA */ + #ifndef cpumask_of_pcibus #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ cpu_all_mask : \ cpumask_of_node(pcibus_to_node(bus))) #endif -#endif /* CONFIG_NUMA */ - #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) #ifndef set_numa_mem