Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2981537iog; Mon, 27 Jun 2022 06:56:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tkM/U5eMW/JH2fzVPZpvlzZFdSgk7EUn3Q7EI25kyfkTHOVEk1SMYE3YMohwqngi6cv4an X-Received: by 2002:a05:6402:1249:b0:435:5e0c:20ac with SMTP id l9-20020a056402124900b004355e0c20acmr16704249edw.100.1656338175309; Mon, 27 Jun 2022 06:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656338175; cv=none; d=google.com; s=arc-20160816; b=HrIl2f1k2t6iVjdXmY9jhm5d6xBhmSbYdZAi/vW67MbiX2r45YmRSdmon+RA+MciAC y54Z1XshTDSXfyfmBtpepBS29wFQXq8rFn/qXfftrvUhzM+1H60fFDpm6Bky4iWeoCp5 EyZdWZ6GMsQpyjdenslCyc5tsvSevEzltHWEeAW3VYYMeuJ3bXdr6fxO/k6rd+fKUQUw 21XA/blKUU8PC9i0v8n/XkCxcfVLKEfuaMBkVklaazSaDDe3astS/9WafwQLrVEFxxR0 KuE09Jmc7L1clk/8PzrSJzzQxRB5RWdORdfA5poHn5c+huL5Y/758fRjSeV8eYMOSDQ1 +h+g== 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=kP7/xh9Tw0MHHmIFjA7ipZXi00TwOpX0xDo+jRp+KJI=; b=xOgasJ7bcK2goszMeVXE4ujF6NJ9C5CwRPxXy3lIwJBF3PZFpvpibBY4Fyrcw2fs2P 1kSdmLheJX6wonUkutzLJ08e0ZAtjB9buM7ImQ7a0n5eATE5gr2+dsJ5L02Cpqy2TDIG 9jEfPWWVxwMHSuTg52KodJYNnYJRMGQC3SHEB+ZyLRaDDGfbf9dCj0VaoiXmtK7pTX+k v8I3cGeN3d7/k0ldxXH/46cEEU2kL2ziIoUp/zBTOJPaa9wegASKJCL4hll13Dhk/goC YG8Joo7X+WstpSggU+m6A/h07jVogpL1t8xWnO3lPpX+FHrpyeq2sUdmx1W1a2iGyOhr W++w== 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 j12-20020a170906830c00b006f39e3cc855si10179273ejx.648.2022.06.27.06.55.48; Mon, 27 Jun 2022 06:56:15 -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 S234842AbiF0NQQ (ORCPT + 99 others); Mon, 27 Jun 2022 09:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbiF0NQA (ORCPT ); Mon, 27 Jun 2022 09:16:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3A433BC0D for ; Mon, 27 Jun 2022 06:12:55 -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 F1CD21758; Mon, 27 Jun 2022 06:12:54 -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 488433F5A1; Mon, 27 Jun 2022 06:12:54 -0700 (PDT) Date: Mon, 27 Jun 2022 14:12:52 +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 16/20] arch_topology: Drop unnecessary check for uninitialised package_id Message-ID: References: <20220621192034.3332546-1-sudeep.holla@arm.com> <20220621192034.3332546-17-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220621192034.3332546-17-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:30 (+0100), Sudeep Holla wrote: > With the support of socket node parsing from the device tree and > assigning 0 as package_id in absence of socket nodes, there is no need > to check for invalid package_id. It is always initialised to 0 or values > from the device tree socket nodes. > > Just drop that now redundant check for uninitialised package_id. > > Signed-off-by: Sudeep Holla > --- > drivers/base/arch_topology.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 46fa1b70b02b..42448a5a9412 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -611,7 +611,6 @@ static int __init parse_dt_topology(void) > { > struct device_node *cn, *map; > int ret = 0; > - int cpu; > > cn = of_find_node_by_path("/cpus"); > if (!cn) { > @@ -633,16 +632,6 @@ static int __init parse_dt_topology(void) > > topology_normalize_cpu_scale(); > > - /* > - * Check that all cores are in the topology; the SMP code will > - * only mark cores described in the DT as possible. > - */ > - for_each_possible_cpu(cpu) > - if (cpu_topology[cpu].package_id < 0) { > - ret = -EINVAL; > - break; > - } > - Maybe it would still be good to keep this for systems with potential errors in DT, where one forgets to add a core in cpu-map. For example, if I modify juno.dts as follows: --- a/arch/arm64/boot/dts/arm/juno.dts +++ b/arch/arm64/boot/dts/arm/juno.dts @@ -51,12 +51,9 @@ core0 { cpu = <&A53_0>; }; core1 { - cpu = <&A53_1>; - }; - core2 { cpu = <&A53_2>; }; - core3 { + core2 { cpu = <&A53_3>; }; }; and miss a little core in cluster1, I would end up with an incomplete topology: core3 would have cluster_id as -1, while all other CPUs would have a valid value; also, core3 would have package_id = -1. Thanks, Ionela. > out_map: > of_node_put(map); > out: > -- > 2.36.1 >