Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2587139yba; Mon, 15 Apr 2019 15:10:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDkT7orUGO9I8xzNbYImI5D59id1jneJChEx61HqY7fI4MTBvmLO/0tE/Tx/wjFKNUlxcg X-Received: by 2002:a17:902:2a2b:: with SMTP id i40mr62365720plb.80.1555366218861; Mon, 15 Apr 2019 15:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555366218; cv=none; d=google.com; s=arc-20160816; b=blWMiFLmXLm1Ry/V5263z4puyGV5qBrKZ1TJKZBGyGzokqgGNtaQ5W5IdvCF2YXTwU TsVkEJQKuhAEjw4VHE5Tqx0V7KCUXAtDq3mY3aKnuv6b7x8XIxGln5gTqgw4xZfvYKt+ UPymeXryzZr60eCaBFwAtP9MWm1wzgnJ/1kB6SptoyKjfMExxAMJzUhX3rToHtS5I0Yg i4gVebKgH9iFqkfrux5ukz1jIW7fYnmn8qg6oUq8zi/W8i7pPdOrLoDZEgCSb178jG5Q Q7JaawD//oswHZwhJI5oQ8Ot0PJBpHb+VmoYJkfhNCe3/AdwsXBtZgrgBscASXB2/1JV Nbmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr :dkim-signature; bh=e4n1Fr74gXk0OgeD8ZGnLVRXNEMjfIuQyqN40QKBqfo=; b=Bawem4QU46ilk1r7olsZVf2IAvliUKWg7WZVKWaIIH6r8h0yOcZAtIvLNped9OptG/ QvDekvlNsvr+I/91mGWrFFkd8e7bpUfcgCCrcksAeYdAaQIbH6/EROHLt/kGUJsSCC4D ua4o+PeZLmatH5R4IgPBr/TvRbBhGTcl9Fe4Gs/EXDIy2utBlrW4yVKDY3e1bkAg6H8l ROB7HjYlPaLaO98Dmr9XdPjen5i+gNvvDVM4Id9eoPp2bifDuxk992T2V5HeOKt1X5ND Thgpi3QgRkHzWlgaNpnUJoqDs12TCXA91Hci1DlH9g82CCMKJljN5ohDC2uqbpUcMmBU NO5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="GJbI/AzT"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j30si46354923pgl.338.2019.04.15.15.10.02; Mon, 15 Apr 2019 15:10:18 -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; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="GJbI/AzT"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728014AbfDOWIs (ORCPT + 99 others); Mon, 15 Apr 2019 18:08:48 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:46517 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbfDOWIr (ORCPT ); Mon, 15 Apr 2019 18:08:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1555366128; x=1586902128; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=bIdsCbNgVTeGyll6RglGPST7YtEfsxDOqqCeO+0jW6Y=; b=GJbI/AzThsSUaKua5mYtveY6SLRLcz+ANpfLiiHEISbhqyxh7l9D+BhJ RJqgNjr7t2MQk5ZPJL5n2EDBftB0h5DhON/6sTK/1zxWot9fVbGQeaBxZ tZAGl82Wq7y4TRwsOQJDeOPEbpojvD1h/CT+tAs1LTyKMDko0Fyh+g4uA 1Q9Qp+lDigf+mlqw4MirBmlgtpQeEUy2ATFu83eG7l2W5NsZVZ+FxmzKZ oIx1D0mQ+EC2ws87hf6ZVEZ7xQbDXxnuQC9s7Z3+QUnVX75fucHv5ruTl yjGnx8m9RhtLdla4uR6MI1UzsYe14+TV9k+r/Jnyi4M0nnMjeOWYYtZ/u g==; X-IronPort-AV: E=Sophos;i="5.60,355,1549900800"; d="scan'208";a="107257940" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 16 Apr 2019 06:08:47 +0800 IronPort-SDR: 5d4OUqKGhiammEIZqeTJjry5peow9nHjrwY69BMnPDCRPFAxMd1V4HWtOfB2OrQmST7WrvKX/j AjbaUOdTURGO9633XH6QMUe10+Ssk9F3L+EbW38bbEllsuGK+rL6Uc+XGY9SNXjEZjYD4gAQAj 4uShfLUc8pP/meOk9XwOkvKEJ8bCrmK98VVl93ONHNiYq7HGPh7VWBTFWOItt3duXAK20FmTBU Cy54fAYNcB8yoqOXixtGVI4+quoBaiBMgK38qYn2k1stqW67Jh9tncmh5J8KkKJ1o/jVvWmCR3 v7CPH0zQub8SNDaxN4iSiJc1 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 15 Apr 2019 14:47:41 -0700 IronPort-SDR: EqBvw8M5kci9MXpnfo4jBCpv+opR8xO7XpQ7/+x4BwpzyBvetVMzVBUhUt3J+RpsgcbgJcAuz9 8c55e2v7iTF27P0mAz+gXZZYj2vOLTJzmf+5fgDn+nUrBqhGzgbuT2A+k5e/v42FAIwEaBvmXQ dJp47lxy21l2I8EUvM9zoufcm257Vvht+H8NBcfmZOzv7hvU2D7F8sqjnAeW0qLE1IwBItAC7E LgXOQqAo8ikg3AkYeX9T+SKEvwPFM1b4+lpS7Cp0t6uUfTaU4e2juVa2clvwMeki2Ur70qjZXL uck= Received: from c02v91rdhtd5.sdcorp.global.sandisk.com (HELO [10.111.66.167]) ([10.111.66.167]) by uls-op-cesaip02.wdc.com with ESMTP; 15 Apr 2019 15:08:47 -0700 Subject: Re: [RFT/RFC PATCH v3 3/5] cpu-topology: Move cpu topology code to common code. To: Sudeep Holla Cc: "linux-kernel@vger.kernel.org" , Jeffrey Hugo , Albert Ou , Anup Patel , Ard Biesheuvel , Catalin Marinas , "devicetree@vger.kernel.org" , Dmitriy Cherkasov , Greg Kroah-Hartman , Ingo Molnar , Jeremy Linton , Johan Hovold , "linux-riscv@lists.infradead.org" , Mark Rutland , Morten Rasmussen , Otto Sabart , Palmer Dabbelt , Paul Walmsley , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Rob Herring , Will Deacon References: <20190320234806.19748-1-atish.patra@wdc.com> <20190320234806.19748-4-atish.patra@wdc.com> <20190415152741.GA28623@e107155-lin> From: Atish Patra Message-ID: <5c5b720f-414a-706c-3415-642c27baef1f@wdc.com> Date: Mon, 15 Apr 2019 15:08:45 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190415152741.GA28623@e107155-lin> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/15/19 8:27 AM, Sudeep Holla wrote: > Hi Atish, > > Thanks again for doing this. Overall changes look good except a couple > of minor nit, see below. > > On Wed, Mar 20, 2019 at 04:48:04PM -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. >> >> 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 | 298 ++++++++++++++++++++++++++++- >> drivers/base/topology.c | 1 + >> include/linux/arch_topology.h | 28 +++ >> 5 files changed, 330 insertions(+), 323 deletions(-) >> > > [...] > >> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c >> index edfcf8d9..6cc6a860 100644 >> --- a/drivers/base/arch_topology.c >> +++ b/drivers/base/arch_topology.c >> @@ -6,8 +6,8 @@ >> * Written by: Juri Lelli, ARM Ltd. >> */ >> >> -#include >> #include >> +#include >> #include >> #include >> #include >> @@ -16,6 +16,11 @@ >> #include >> #include >> #include >> +#include >> +#include >> +#include >> +#include >> +#include >> >> DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE; >> >> @@ -278,3 +283,294 @@ static void parsing_done_workfn(struct work_struct *work) >> #else >> core_initcall(free_raw_capacity); >> #endif >> + >> +#if defined(CONFIG_ARM64) || defined(CONFIG_RISCV) > > Why can't the above one be just GENERIC_ARCH_TOPOLOGY ? > I may be missing to find it myself, but would like to know. > GENERIC_ARCH_TOPOLOGY is now used for both RISCV, ARM & ARM64. The below functions under this #ifdef have different implementation for ARM and ARM64. parse_dt_topology cpu_coregroup_mask update_siblings_masks While we can combine the later two functions and move them to common code as well, parse_dt_topology is significantly different. That's why we need some kind of #ifdef or renaming of parse_dt_topology for ARM32 code. Thanks for the review!! Regards, Atish >> + >> +#if defined(CONFIG_ARM64) || defined(CONFIG_RISCV) > > Ditto. > > -- > Regards, > Sudeep >