Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6157580ybi; Wed, 29 May 2019 03:49:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcUa2m0h0GQ4eXPp416CJeEgf0u53w1x9yCuvjhiO/OUBK1ingar1PIjOEbhoUNaTK7NdR X-Received: by 2002:a17:902:7883:: with SMTP id q3mr65832712pll.89.1559126975549; Wed, 29 May 2019 03:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559126975; cv=none; d=google.com; s=arc-20160816; b=i3wOufSQcUFWEhDVOrUt5eXDxuFFmA520VcFjAOJTm1MHAflDheFQYvx0rJj6gOiS4 IKWUNfX0+inqdvci0GnHkKgFW4PCwNX863n/0Xw66Rs7e275aCguOVe1O+O5mRZ85D4k VANn7FA45Aj+3lxw2NTgnEI0tfoQNDV0ez+va2e2X+9bIFDxRt2Ce9FwE99TzbcREdt9 7AHxWyFGTkOKmahMzWre+c3mptV8b5pAmobNl6/MzWrLjI1XZqlKQQxJE3lc9EVxOtsb XvZoDUR1yOqTxLP9fuObSByfNFCiTz7oVz++HBr9KyLeV7gOt3hCx/jkZn+9mbUEkvJb X0oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DwT0Qc28yo5FteBks1oAVaQ1wI+GZ4x9BR85usUe3Ec=; b=gquLu254oEMIRt5r/hJsEgzQ5/CLflaI9NMyyrPRzF/WD/kgk3nwC0EyCktlMpY2UH M2UdbAVmM0x2+OSUIlMCz5NOQpvhrn0GFo71un/wDRIhFDXQQGRmqceDkWmkrMw5EoWR 3wZ5QtRLAFHnHXlOHAOuLoGMO7yDMaFOib09uNoD39AyXCKkcfqnCB22wGhFhFJGfYUV J3OTw2ulBJtS/KMAjasMd+7TgMpi/dkzpj/chDgfog3rq/ubH5OiAkvoMpHJ3Ggas73C 2Ml+JeWv9YQbAgDT004awzkMNLJf8cbzl/DkOEzMpOXch3kc1u3YeIwDpfaTP0VG0Qbf 4Y3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg10si25644658plb.28.2019.05.29.03.49.19; Wed, 29 May 2019 03:49:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726256AbfE2KsR (ORCPT + 99 others); Wed, 29 May 2019 06:48:17 -0400 Received: from foss.arm.com ([217.140.101.70]:43354 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726024AbfE2KsQ (ORCPT ); Wed, 29 May 2019 06:48:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0A32A341; Wed, 29 May 2019 03:48:16 -0700 (PDT) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 333153F59C; Wed, 29 May 2019 03:48:12 -0700 (PDT) Date: Wed, 29 May 2019 11:48:01 +0100 From: Sudeep Holla To: Atish Patra Cc: linux-kernel@vger.kernel.org, Jeffrey Hugo , Albert Ou , Andreas Schwab , Anup Patel , Catalin Marinas , devicetree@vger.kernel.org, Greg Kroah-Hartman , Ingo Molnar , Jeremy Linton , linux-riscv@lists.infradead.org, Mark Rutland , Morten Rasmussen , Otto Sabart , Palmer Dabbelt , Paul Walmsley , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Rob Herring , Thomas Gleixner , Will Deacon , Sudeep Holla , linux-arm-kernel@lists.infradead.org Subject: Re: [RFT PATCH v5 3/5] cpu-topology: Move cpu topology code to common code. Message-ID: <20190529104801.GA13155@e107155-lin> References: <20190524000653.13005-1-atish.patra@wdc.com> <20190524000653.13005-4-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190524000653.13005-4-atish.patra@wdc.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 23, 2019 at 05:06:50PM -0700, Atish Patra wrote: > Both RISC-V & ARM64 are using cpu-map device tree to describe > their cpu topology. It's better to move the relevant code to > a common place instead of duplicate code. > I couldn't test this on any ARM64 server platforms, tested on Juno and other embedded platforms. Tested-by: Sudeep Holla Reviewed-by: Sudeep Holla > Signed-off-by: Atish Patra > Tested-by: Jeffrey Hugo > --- > arch/arm64/include/asm/topology.h | 23 --- > arch/arm64/kernel/topology.c | 303 +----------------------------- > drivers/base/arch_topology.c | 296 +++++++++++++++++++++++++++++ > include/linux/arch_topology.h | 28 +++ > include/linux/topology.h | 1 + > 5 files changed, 329 insertions(+), 322 deletions(-) > [...] > diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c > index 0825c4a856e3..6b95c91e7d67 100644 > --- a/arch/arm64/kernel/topology.c > +++ b/arch/arm64/kernel/topology.c > [...] > -static int __init parse_cluster(struct device_node *cluster, int depth) > -{ > - char name[10]; > - bool leaf = true; > - bool has_cores = false; > - struct device_node *c; > - static int package_id __initdata; > - int core_id = 0; [Ultra minor nit]: you seem to have reordered the above declaration when you moved, just noticed as it showed up when comparing. > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 1739d7e1952a..20a960131bee 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c [...] > + > +static int __init parse_cluster(struct device_node *cluster, int depth) > +{ > + char name[10]; > + bool leaf = true; > + bool has_cores = false; > + int core_id = 0; > + static int package_id __initdata; > + struct device_node *c; > + int i, ret; > + [...] > +#if defined(CONFIG_ARM64) || defined(CONFIG_RISCV) > +void update_siblings_masks(unsigned int cpu); > +#endif > +void remove_cpu_topology(unsigned int cpuid); > + Another thing(not a block and we can do it once this is merged) is to remove these #ifdefs -- Regards, Sudeep