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: 7991871 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 5C3FF9F54F for ; Sat, 9 Jan 2016 06:06:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F754201ED for ; Sat, 9 Jan 2016 06:06:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3AEB20173 for ; Sat, 9 Jan 2016 06:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751256AbcAIGFU (ORCPT ); Sat, 9 Jan 2016 01:05:20 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38151 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108AbcAIGFT convert rfc822-to-8bit (ORCPT ); Sat, 9 Jan 2016 01:05:19 -0500 Received: by mail-wm0-f44.google.com with SMTP id b14so199397657wmb.1; Fri, 08 Jan 2016 22:05:18 -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 Cc: Bjorn Helgaas , Ganapatrao Kulkarni , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , linux-pci@vger.kernel.org, Catalin Marinas , Bjorn Helgaas , Hanjun Guo , Robert Richter , Prasun Kapoor Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 --- 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 --- 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