Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3000794iog; Mon, 27 Jun 2022 07:15:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tCqXvRN5tuZLwYOWy7TnAXDsbPnzMwlnCfotAd74bbDRpXTdeFT7bKBbB2a9H8Ip/KwNan X-Received: by 2002:a05:6402:44a:b0:437:8234:f4c6 with SMTP id p10-20020a056402044a00b004378234f4c6mr150749edw.346.1656339304188; Mon, 27 Jun 2022 07:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656339304; cv=none; d=google.com; s=arc-20160816; b=hbxE7bvLvzMERoHv5AJ8E+vpWHG/islV7/kDPhoK7d0EAf8J4m89IPY+IWUnp9ir23 4qMfgq9OYO0ocoEJI6mOrTvuerJzWMwf8gfoyaDByFouD4jRUOamo2m4oWh/6QL2OVve /BYwi4Zey6ttNz4Bg2BIl/1pOb1WufNjwZ5rqhBD/7qhIASVkLbADlvotrbUP1/a8ahN LMdLHDbZclOAjzzgKRkUTDo6ssgWT+zOiWxDpZsix9izadVdphBCNsnO412mLKDtSnn3 PNbzJO3v91oCOIH/OvO+aYOWn28NiMpAR6Aa8U5PHYaqDNfAbNh7Pye7RVD6YYVACCp6 uWnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hxfDBgQ8R4nyULrvjhCScJf7rcQW3Z56DqCs1j/8ZAo=; b=SblxVW1RvOofg5KrnDas5r2wua0M4wvHXWRmtgYqDJZ1gtrM2chdNp54UbI3xCocGH jYewRcB0OMTrNrMh8pG2bJo8r2WDmgqbujRPj+VPpypdwQ0bYt5BMDTdVMFkUayzI1wq GdMa9M40xzMILA8t5rYSpsHtny8fGEWh7BkkWgzdXgodc37jKMkpgVbihoP2IHrgOHJU WCK75yrKEd09MboMYPElvpeLSJgMJv60rfQw80Ok3bOxoXBUnJNTlQoaKFRZtc2R+OND YK+q4c1PqWitYOc2vuW1BiwDBCgm2HoPDfxPxNHaIXFk2MW+xYeUXYzMk4E47ljDSKFt WTwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a50e701000000b0043565c5a2fbsi12241637edn.89.2022.06.27.07.14.38; Mon, 27 Jun 2022 07:15:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236234AbiF0NrV (ORCPT + 99 others); Mon, 27 Jun 2022 09:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236017AbiF0NrU (ORCPT ); Mon, 27 Jun 2022 09:47:20 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C301A5FE6 for ; Mon, 27 Jun 2022 06:47:19 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B3E7C175A; Mon, 27 Jun 2022 06:47:19 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.1.196.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 251923F5A1; Mon, 27 Jun 2022 06:47:19 -0700 (PDT) Date: Mon, 27 Jun 2022 14:47:17 +0100 From: Ionela Voinescu To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, Greg KH , Atish Patra , Atish Patra , Vincent Guittot , Dietmar Eggemann , Qing Wang , Rob Herring , "Rafael J . Wysocki" , Pierre Gondois , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v4 18/20] arch_topology: Set cluster identifier in each core/thread from /cpu-map Message-ID: References: <20220621192034.3332546-1-sudeep.holla@arm.com> <20220621192034.3332546-19-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220621192034.3332546-19-sudeep.holla@arm.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 21 Jun 2022 at 20:20:32 (+0100), Sudeep Holla wrote: > Let us set the cluster identifier as parsed from the device tree > cluster nodes within /cpu-map. > > We don't support nesting of clusters yet as there are no real hardware > to support clusters of clusters. > > Signed-off-by: Sudeep Holla > --- > drivers/base/arch_topology.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 39be5dbaf4da..75604f783bfc 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -497,7 +497,7 @@ static int __init get_cpu_for_node(struct device_node *node) > } > > static int __init parse_core(struct device_node *core, int package_id, > - int core_id) > + int cluster_id, int core_id) > { > char name[20]; > bool leaf = true; > @@ -513,6 +513,7 @@ static int __init parse_core(struct device_node *core, int package_id, > cpu = get_cpu_for_node(t); > if (cpu >= 0) { > cpu_topology[cpu].package_id = package_id; > + cpu_topology[cpu].cluster_id = cluster_id; > cpu_topology[cpu].core_id = core_id; > cpu_topology[cpu].thread_id = i; > } else if (cpu != -ENODEV) { > @@ -534,6 +535,7 @@ static int __init parse_core(struct device_node *core, int package_id, > } > > cpu_topology[cpu].package_id = package_id; > + cpu_topology[cpu].cluster_id = cluster_id; > cpu_topology[cpu].core_id = core_id; > } else if (leaf && cpu != -ENODEV) { > pr_err("%pOF: Can't get CPU for leaf core\n", core); > @@ -543,7 +545,8 @@ static int __init parse_core(struct device_node *core, int package_id, > return 0; > } > > -static int __init parse_cluster(struct device_node *cluster, int depth) > +static int __init > +parse_cluster(struct device_node *cluster, int cluster_id, int depth) > { > char name[20]; > bool leaf = true; > @@ -563,7 +566,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth) > c = of_get_child_by_name(cluster, name); > if (c) { > leaf = false; > - ret = parse_cluster(c, depth + 1); > + ret = parse_cluster(c, i, depth + 1); > of_node_put(c); > if (ret != 0) > return ret; > @@ -587,7 +590,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth) > } > > if (leaf) { > - ret = parse_core(c, 0, core_id++); > + ret = parse_core(c, 0, cluster_id, core_id++); > } else { > pr_err("%pOF: Non-leaf cluster with core %s\n", > cluster, name); > @@ -626,7 +629,7 @@ static int __init parse_dt_topology(void) > if (!map) > goto out; > > - ret = parse_cluster(map, 0); > + ret = parse_cluster(map, -1, 0); > if (ret != 0) > goto out_map; > > -- > 2.36.1 > Reviewed-by: Ionela Voinescu Thanks, Ionela.