From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35649C43334 for ; Mon, 27 Jun 2022 16:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=quSh98Myp+bTDycB5ZLXW+AzDBtycqGwJAsZUlXZOUc=; b=Ac3mSVqQI29dCC HLZc14zDOxC5ozg70bcxIfMZGfLTlazQ2jcZdjV6chazCERT4l/JFAqJuv7T7iUbwmsOldlqGR8kH 5+0bnP+cHA+0XdrcUFkaRb8CV71FbOi3d6rTxOa6VBE2aqkdrP3OTAhXn4lkq3gjGAgzQdhDNHv2e eim2bm3f0/7gGC5mw5AtzuYue8KFioYDkXXTBXwMe1kASx4qoTLOmvAMaewBE7fS0keFu3Z1vkCpP XfriEeCc9H5oqNkt4gLbhJpAG5NRzC0t8c++U7k+mpOMhDQJY5rN9dQkbPUkwswK2fsoVCUa66oJ7 aDczDBOPnl0N8KsZM3bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5re6-001qbU-8i; Mon, 27 Jun 2022 16:31:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5rdy-001qYo-Mv; Mon, 27 Jun 2022 16:31:24 +0000 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220627_093122_904868_230B5B9E X-CRM114-Status: GOOD ( 29.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel