Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3164938iog; Mon, 27 Jun 2022 10:28:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1svHofsnzjI9hlMETEGqC0pgjAbvJJtu1UqP4zi72JJvNCSyY+e1lhjmMwymao/HV7PEQi+ X-Received: by 2002:a05:6402:4302:b0:437:7990:992e with SMTP id m2-20020a056402430200b004377990992emr13613088edc.194.1656350883980; Mon, 27 Jun 2022 10:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656350883; cv=none; d=google.com; s=arc-20160816; b=BnhLtvdlHb8BmcX3SPkRSZLpJHGYUw6Ch9am0mZWI2MAPAtF+HfJASjjIBZ1eGEaAt p8MGmASQNwEdEOpUyyil2JYPvPM+JHWArvm3GUwDQh93XfYk1QB8AuhI2MnpmjdbTVjw JPeTmDKrDBx7KZ2vZ89ad4KwduEAKSj2is+A/VTjX0snH/IAPAm7c44oKL5RV1CNLw8T a1t+NMJkH1I+Jj1MT1/xYW24L/nYqzA4rj5Di8j6ytdcfJA25AUNkUSB136tA9S1hAq2 W+pPPtAPXLtrVVlU6p6Tygl02ocrIJeMei3np1/QbluNgKh2ICQKQuh2UfcDLHX2UJ8R 2laQ== 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=28vhJkNM3qs/HF6R4mVLo9Mw3tP+LerT/HVzOFXLLWo=; b=aBiz/q70vjcUEW6iCD8grYMCACm16VYmG5/N6oW/iL7X9iqG0OfSRf0h3yGJKARTna OgFuU8mcYX549F3o1SCdMAX4GNR+VcQAVx0vZ9/Kvnw8xRyV630h/QHrPit7bgkFKKf/ b96Stiak/TLWhjsBH3mL4ARgYzBXDYFiQKSBPuPFK6QyMQUOaT60hG2Lekt17p6oS4Oo LLJOgiBqIlTNwSMDwxwiXO5XvCIPafeMUCstcX1VXXxpD0DMldNJJw8DvW2+Hx1IgpNe FH4knEYH6xV1ycS5jyGj6Ig3dVUFDE3V1svOKRpX/LgwiTg/7ekcxGmYRvp2tD9VHdRO LWbA== 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 hv18-20020a17090760d200b007115ac2292dsi13764839ejc.335.2022.06.27.10.27.39; Mon, 27 Jun 2022 10:28:03 -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 S239238AbiF0QbY (ORCPT + 99 others); Mon, 27 Jun 2022 12:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239239AbiF0QbW (ORCPT ); Mon, 27 Jun 2022 12:31:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5723AB7CC for ; Mon, 27 Jun 2022 09:31:21 -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 54AEA1758; Mon, 27 Jun 2022 09:31:21 -0700 (PDT) Received: from bogus (unknown [10.57.39.193]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 438F13F66F; Mon, 27 Jun 2022 09:31:19 -0700 (PDT) Date: Mon, 27 Jun 2022 17:30:08 +0100 From: Sudeep Holla To: Ionela Voinescu 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: <20220627163008.qnyx27arpxmihpya@bogus> 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: 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 Mon, Jun 27, 2022 at 02:12:52PM +0100, Ionela Voinescu wrote: > 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. > Though I would ideally prefer to catch such DT issues with schema, I know we are no there yet. So I agree to retain this. > 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. > Indeed. I didn't consider the case where DT would have issues when I dropped this check. I will drop this patch. Thanks again. -- Regards, Sudeep