Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp234698pxa; Thu, 27 Aug 2020 00:12:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7/1r/mbVwpjCfCOOmulBS5AmoRl+lMu3WexvLM2/n3G3qqzfBRRm50hUSd5PeFMYXoiaC X-Received: by 2002:a17:907:72d2:: with SMTP id du18mr5988025ejc.359.1598512327712; Thu, 27 Aug 2020 00:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598512327; cv=none; d=google.com; s=arc-20160816; b=OgpwiZsBWvdOtmas3FnYfbYHcs1nlzRi3mNYkxocL7U8MlyMvfv5KoCkLjpG4eJDvC vKab+bK6idXW37ka4mk4kMU2GSlBEnSCgED/NlID4DbdKA5r6lQPKnpQ9W4lZVv9iL+M Y1hF0i6wH9NU4w7+rqblK5DQpRo0ypLUFXN57Pvzr65rTpcct/1rGma4J554AHqky0nV gCYy0A0cLSaXlSOt9mYs2FgjzVrwo8z07rvBncv5I0YIZLM2cyWaMqbb2iW96cGmgyCK d10gA5qPj6P0/e/LMiK/SVHzd4o1VDNinaf3qWbIiuFMfWqKowxwAakZqnWpijRzZ9+B 2dOg== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :ironport-sdr:dkim-signature:ironport-sdr; bh=FBKqFUmrPAJAbqShy7f5A1DAj0DfxupkLKrtdAwh+PE=; b=UQzyMrTZBKVh+Ah5OmBGth4n3lZKPdszVt1al3sWjARKxCQEocoW+R81KnxF+1q9da Q+bF60+P9IG+YAPU8x3Qb8gJsA6MVagKqLgn7O2z2DNIT20ssi8gagALJ9K47OJTPZLP 2hy1WG1RvjuXbTZLNTeQQ0rhnSkDmyjtjyemtjXh4Zi/ImOVXY7+sKmbtDEVuKO8I8Fo rn5vw8UFfq6Ugdo0oGL/obvZ4wp3c/3yqyLg53+XKpogRZ5077wrSv2CIAGwSL60L9XJ tfciekBzigbpZ+eFdFQ3oQYAJJSIqg3OyqbwmG3q1LIeJgjCqBagaDpHZJ/DTLYMqagq QFCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=mBNBSYeh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si1023572edt.107.2020.08.27.00.11.44; Thu, 27 Aug 2020 00:12:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=mBNBSYeh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727115AbgH0HKy (ORCPT + 99 others); Thu, 27 Aug 2020 03:10:54 -0400 Received: from mx1.tq-group.com ([62.157.118.193]:10903 "EHLO mx1.tq-group.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbgH0HKx (ORCPT ); Thu, 27 Aug 2020 03:10:53 -0400 IronPort-SDR: yAinwcX2cCEO4+JYSsZAnSZVow9K+EXg/qtccYjOqFlUOYwjBluXiuaF5k6R3gzN/UWnL/iT3q 1tWWpqDqP3H/E6TQwPaLvIYxUWlRdNvn8PtmRJmAuDZbiZKqpl/XiYlW3SXMztmf70DDsldCJy AKaJLLgFycV4BtoZo3k6Bi55JWYJb/KG0zv4F1+KZdVL7k4wnmc7SZqBtVLmy3RNJ4OBmlLqj/ uf5pM1htVu93wf0DSyhcUKS/FEEhamH1NWitWsa2dCDdjYEqOlO+ysuJPlg2+OgpDmXG18j3xH vTU= X-IronPort-AV: E=Sophos;i="5.76,358,1592863200"; d="scan'208";a="13618338" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 27 Aug 2020 09:10:51 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Thu, 27 Aug 2020 09:10:51 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Thu, 27 Aug 2020 09:10:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1598512251; x=1630048251; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=xXOxLC3BdznWqny8YpTk2yIBPWxEpNFBh+biUoffHDg=; b=mBNBSYehf6JlNJ+DNKrJaGTAMOINbNY6mKPhVIazjkYz5Qk4PfcVoPk0 PW3itPEBk+NnmALVubX8lzd4QvxzYFT9WZiDUCySZm4uCzwFndAYWmTth DCh5tYZ5/io+ogrLYyWt5Eh1oT//vEZmrmqk8+vC5wJ7Z1+0ds/L9i+BA OqaBAV0fRpr0uUAErhO7HSeKq9AYXKAq+ehVuMaC21wSq5FLq+dq/39Ti mqtRwbdrfNKMEbP16PvpNc9wwJ3XC4u044F+wxMSi0YAkvGYLrkc/3Iw3 GgqT2fuRvxXG9hVZJdNdByAM/9zewqpVjeWzu9nFlOupkk4DCKqEbmnrg Q==; IronPort-SDR: B3DP9B8sACzyKKNq8PJO6mVfwl6O1xOuyAK969Yp/M9eXYNY9qDNQY/BPr6oKzlU86TnMAGOzV oIMBvIQusk7FbAc6hQllYYiBZYFquLQFYDIzKQDSiOFBzKxFQIvwQH40zf7/jLn4+0ms9iZuP3 vPDpzWUYxi5emb8zRPzNKL3pCBD6/NgQC8kXzVmevZ2J3RAxRHFb6VvTPQfrWoDQFleNfA4OWl mOchBpVBTta/JR/4+/PJi9eCW7q6uPMcCELtCZCebcl2B1V85HXedTI8FMz9mwH7BkLX/7opV/ Ris= X-IronPort-AV: E=Sophos;i="5.76,358,1592863200"; d="scan'208";a="13618337" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 27 Aug 2020 09:10:51 +0200 Received: from schifferm-ubuntu4.tq-net.de (schifferm-ubuntu4.tq-net.de [10.117.49.26]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id 54249280065; Thu, 27 Aug 2020 09:10:51 +0200 (CEST) Message-ID: Subject: Re: (EXT) Re: (EXT) Re: [PATCH] of: skip disabled CPU nodes From: Matthias Schiffer To: Rob Herring Cc: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Frank Rowand Date: Thu, 27 Aug 2020 09:10:49 +0200 In-Reply-To: References: <20200826120254.8902-1-matthias.schiffer@ew.tq-group.com> <4dd06b79-1402-d7cf-9676-1f9a9526da12@gmail.com> <9eb72c6561333661599411e49072928385629999.camel@ew.tq-group.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-08-26 at 13:26 -0600, Rob Herring wrote: > On Wed, Aug 26, 2020 at 8:47 AM Frank Rowand > wrote: > > > > Hi Rob, > > > > On 2020-08-26 08:54, Matthias Schiffer wrote: > > > On Wed, 2020-08-26 at 08:01 -0500, Frank Rowand wrote: > > > > On 2020-08-26 07:02, Matthias Schiffer wrote: > > > > > Allow disabling CPU nodes using status = "disabled". > > > > > > > > > > This allows a bootloader to change the number of available > > > > > CPUs > > > > > (for > > > > > example when a common DTS is used for SoC variants with > > > > > different > > > > > numbers > > > > > of cores) without deleting the nodes altogether (which may > > > > > require > > > > > additional fixups where the CPU nodes are referenced, e.g. a > > > > > cooling > > > > > map). > > > > > > > > > > Signed-off-by: Matthias Schiffer < > > > > > matthias.schiffer@ew.tq-group.com > > > > > > > > > > > > > > > > --- > > > > > drivers/of/base.c | 2 ++ > > > > > 1 file changed, 2 insertions(+) > > > > > > > > > > diff --git a/drivers/of/base.c b/drivers/of/base.c > > > > > index ea44fea99813..d547e9deced1 100644 > > > > > --- a/drivers/of/base.c > > > > > +++ b/drivers/of/base.c > > > > > @@ -796,6 +796,8 @@ struct device_node > > > > > *of_get_next_cpu_node(struct > > > > > device_node *prev) > > > > > of_node_put(node); > > > > > } > > > > > for (; next; next = next->sibling) { > > > > > + if (!__of_device_is_available(next)) > > > > > + continue; > > > > > if (!(of_node_name_eq(next, "cpu") || > > > > > __of_node_is_type(next, "cpu"))) > > > > > continue; > > > > > > > > > > > > > The original implementation of of_get_next_cpu_node() had > > > > that check, but status disabled for cpu nodes has different > > > > semantics than other nodes, and the check broke some systems. > > > > The check was removed by c961cb3be906 "of: Fix cpu node > > > > iterator to not ignore disabled cpu nodes". > > > > > > > > It would be useful to document that difference in the > > > > header comment of of_get_next_cpu_node(). > > > > > > > > -Frank > > > > > > Hmm, I see. This difference in behaviour is quite unfortunate, as > > > I'm > > > currently looking for a way to *really* disable a CPU core. > > > > > > In arch/arm64/boot/dts/freescale/imx8mn.dtsi (and other variants > > > of the > > > i.MX8M), there are 4 CPU nodes for the full-featured quad-core > > > version. > > > The reduced single- and dual-core versions are currently handled > > > in > > > NXP's U-Boot fork by deleting the additional nodes. > > > > > > Not doing so causes the kernel to hang for a while when trying to > > > online the non-existent cores during boot (at least in linux-imx > > > 5.4 - > > > I have not checked a more recent mainline kernel yet), but the > > > deletion > > > is non-trivial to do without leaving dangling phandle references. > > > > Any thoughts on implementing another universal property that means > > something like "the hardware described by this node does not exist > > or is so broken that you better not use it". > > There's a couple of options: > > The DT spec defines 'fail' value for status. We could use that > instead > of 'disabled'. > > The spec behavior with cpu 'disabled' is only on PPC AFAIK. On > arm/arm64 (probably riscv now too) we've never followed it where we > online 'disabled' CPUs. So we could just make the check conditional > on > !IS_ENABLED(CONFIG_PPC). This would need some spec update. On ARM(64), the "disabled" status on CPUs doesn't have any effect. I assume this changed with the mentioned commit c961cb3be906 "of: Fix cpu node iterator to not ignore disabled cpu nodes", as reverting it gives me the desired behaviour of considering the disabled CPUs non-existent. So it seems that we already changed the interpretation in a non- compatible way once (back in v4.20), and somehow PPC has yet another different behaviour? How do we get out of this mess? Is going back to the v4.19 logic for non-PPC platforms an acceptable regression fix, or would this be considered another breaking change? > > > Matthias, if Rob thinks that is a good idea, then you should start > > with a new proposal that is also sent to > > devicetree-spec@vger.kernel.org > > > > -Frank > > > > > > > > Kind regards, > > > Matthias > > >