Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp393548pxk; Fri, 11 Sep 2020 09:42:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbyNlKsI3nMM2y40RHycjXFnh0tenH5v2D8D/hcsEawu5s1yqZk3AulMuSNLLxH4Q6ncEl X-Received: by 2002:a05:6402:176e:: with SMTP id da14mr3103279edb.349.1599842565885; Fri, 11 Sep 2020 09:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599842565; cv=none; d=google.com; s=arc-20160816; b=srK/+DF3FLbq40Zq4PgZ1UzihO6wRr+qqw+qxx3n+494QNMVEL7rIGeRzYIsu3Wg7N JqpazoqVpWebDZbVFL7izVH3v/ZVLSopix24ZudlLZq3gKkcR5oe7einklU7dFvI3L2O c7LNHkr8hSZlBk+CgKPmnw41Mj/V7ZLXRJOWcudZABFjsyiukAzEDwkYjBGqzNHwI4mS 63iu9RXcingJOsKx9C2pMaSuX88ZBhHht1NqOI8Zpqy5A5B7TnDsZlKp4VavePSR+JrL FYFkZusMurB882bUqHZdEoEKz/ehuc0H3m5ask7jCbFMZdGL4Py/2e6IsZZetVeBldyX x7jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FTxGdMGV3rapitRut8OA4Fjo29OIVMgG3dH1ljjIHq4=; b=nUimP2+5/h6T/BfMQcKHrjpf5gUgZG0O5Pb1jzlVscDaa3d9hdc3R7a3mAzWFts9Un GKtN1rXqMf08G19r+nfq5DROWFIjgDpjFPktReC+1aFPvhQZajqOyAjDIPjV4pi3cayH i0qyplf7gFz9asrwlekILHsmfI6okCqIAizFGnmXgkdPVWHMmMdWMDfvLcmPupfkaqew wOmDUWR4q6Kck4Bk2rVC+GhbpM8V0ITddQoZsV9A/jGa+0SboRl02XXTGO/sZlC/8huv efcV1sVSuptN/9Rz5rnkWfPWB9ixtfpL6i73JNllEn0LBbEIDNOruwd0ZZHcTNsrPdrO JoHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DyOQR0vK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si1643059ejw.31.2020.09.11.09.42.22; Fri, 11 Sep 2020 09:42:45 -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=pass header.i=@kernel.org header.s=default header.b=DyOQR0vK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725833AbgIKQli (ORCPT + 99 others); Fri, 11 Sep 2020 12:41:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:47882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726403AbgIKPKv (ORCPT ); Fri, 11 Sep 2020 11:10:51 -0400 Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27BB4222D9; Fri, 11 Sep 2020 14:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599835421; bh=FTxGdMGV3rapitRut8OA4Fjo29OIVMgG3dH1ljjIHq4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DyOQR0vKPCwij4NYetqRa7C5Kmex5BfD6ov1ZtH9EuiqxbZXBjHAr6cYDZEf/p8bU XZ/i6PohwH46vqkc8B08yhYU6SPRuFIyKq48Y09IlqH3K2mvEYg0EJ1C28zhlcdSfO cpy+wUI8LSH4fdpr2WaYN6MYzK/oz8QSsg/RSLbY= Received: by mail-oo1-f41.google.com with SMTP id h9so2334089ooo.10; Fri, 11 Sep 2020 07:43:41 -0700 (PDT) X-Gm-Message-State: AOAM5307qRhyFVI+fYjkipf5PZecpKpz5SZ2b0oPCWXcG3GwStCFp3Il 2nyoMkJjXtezX1I1YHuivz6BZdyRVaK1imAW6Q== X-Received: by 2002:a4a:9d48:: with SMTP id f8mr1840695ook.50.1599835420448; Fri, 11 Sep 2020 07:43:40 -0700 (PDT) MIME-Version: 1.0 References: <20200826120254.8902-1-matthias.schiffer@ew.tq-group.com> <4dd06b79-1402-d7cf-9676-1f9a9526da12@gmail.com> <9eb72c6561333661599411e49072928385629999.camel@ew.tq-group.com> <735c00caa90746d20bfaafa42c4d911c61729228.camel@ew.tq-group.com> In-Reply-To: <735c00caa90746d20bfaafa42c4d911c61729228.camel@ew.tq-group.com> From: Rob Herring Date: Fri, 11 Sep 2020 08:43:29 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of: skip disabled CPU nodes To: Matthias Schiffer Cc: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Frank Rowand Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 9, 2020 at 2:58 AM Matthias Schiffer wrote: > > On Thu, 2020-08-27 at 09:10 +0200, Matthias Schiffer wrote: > > On Wed, 2020-08-26 at 13:26 -0600, Rob Herring wrote: > > > On Wed, Aug 26, 2020 at 8:47 AM Frank Rowand < > > > frowand.list@gmail.com> > > > wrote: > > > > > > > > Hi Rob, > > > > > > > > On 2020-08-26 08:54, Matthias Schiffer wrote: > [snip] > > > > > > > > > > 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? Yes, this is my 2nd option above. Need to double check MIPS and Sparc though. > Any new insights on this? I'll gladly provide patches or proposals for > a spec update if we can decide where we want to go with this. I gave 2 options. I'm fine with either one (or both). Using 'fail' is the simplest. Rob