Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6142997imd; Wed, 31 Oct 2018 07:27:25 -0700 (PDT) X-Google-Smtp-Source: AJdET5dlCkc9/B56jIZujX7ru/iDeFEXE64akNUSSOtciuII2Oh4CjGnmruI42pIAY5qZFMbKQ6o X-Received: by 2002:a62:5d89:: with SMTP id n9-v6mr3831180pfj.54.1540996045372; Wed, 31 Oct 2018 07:27:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540996045; cv=none; d=google.com; s=arc-20160816; b=Qaev7Y4GJXZzQwubMXLeeDx/oIK4jgI2zoTK7UezW+qtYx0BFRg6i1b8DZaPfSc1Ae eD4zN5V6MOKq1sEMZsprtg6x82ZIjPHtEgzZu8ubcxFRDLyrXfT8HiexpzuVRR7SB36R r46VND/BWtnNjc2Q3MWzE/Apb0vzN2CBHSehWcNE6wkO6U7mT3NxMvhTHjGonW90h9rO FtfnECukwvOxBLL+k1uh/tGziH2YZXVrxEq31E1xqiglZC5rTowfKIPSHk205KcN9QKC ksQ9LNKd1hjkPY9TB3mKNnGryV5LFxTDcWvWhIBqlzOxLY0TP5ikrDtoNeVbZzp0MpPI zB3Q== 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=JDEKB/goZztVXOdPEzm6G9sAYNTUl6alxZrdb9wTYc0=; b=Sl5wsyLw7ceCQozIYOtEw7qkIm5owe0YJG2qeNn5nKrdEzWhkbp/I5Qyq1VpfIFtKW ssQblIwWgE6/eBaOCVLTAVqWIM9vMPkkDis9gml35HeX8CcCcxuO+x+Htyc4BS7Z11lY todXK0cCkNvU8LV4xg4Xf6WAl5oR5k8lmFsuFRgf7me3DwEosGKvxHxRvKyec67UU2rK zwN4eAiuRNBustiLiQM8pDTTLGWRGxyQEXFb/OPjzzvRN23k90zw87+0jYMEEzMiQzrT T+TD2nQ/3sbxtDF0lsd2WJJNDcLQTn3PHrYVRLN3MDdMvXJVEnxBhqoh8YrDZRSbwVGM CdTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WZaagSOn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id o125-v6si26739859pgo.302.2018.10.31.07.27.08; Wed, 31 Oct 2018 07:27:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WZaagSOn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729618AbeJaXYZ (ORCPT + 99 others); Wed, 31 Oct 2018 19:24:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:37452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729492AbeJaXYZ (ORCPT ); Wed, 31 Oct 2018 19:24:25 -0400 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 67D68205F4; Wed, 31 Oct 2018 14:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540995969; bh=iTdI3PcKb3WYFvgfSFAAbWJqUh/yxX97Wq6VNE4qmA0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WZaagSOn9GAiiBvCkhwwdHNVpV1vEF+iDKSIqgY1GESWZZczTczhZuif9+Zvlqna3 gKsKPNuZnKxpAMjYOdI1+3vo2H+j0OMyFWkpD/Vy4hUAohdyNwITHdf84VmgWrWEnc kzqsCfO3BgNTquFTSt3IQRIXGj+M0etOsZGkymnc= Received: by mail-qk1-f180.google.com with SMTP id e4so9711910qkh.6; Wed, 31 Oct 2018 07:26:09 -0700 (PDT) X-Gm-Message-State: AGRZ1gLxKF/Q/li6DLnGrdkQZNgYN4Ac0WaeQVlAy6pKns83HPhY7bd2 uMXckH6RmBqm1iUzoW2vC1GFBDzlNqvCc/Gdaw== X-Received: by 2002:a0c:8c8a:: with SMTP id p10mr2888818qvb.218.1540995968603; Wed, 31 Oct 2018 07:26:08 -0700 (PDT) MIME-Version: 1.0 References: <20180905193738.19325-1-robh@kernel.org> <20180905193738.19325-21-robh@kernel.org> <87r2g6ffm8.fsf@concordia.ellerman.id.au> In-Reply-To: <87r2g6ffm8.fsf@concordia.ellerman.id.au> From: Rob Herring Date: Wed, 31 Oct 2018 09:25:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: NXP P50XX/e5500 secondary CPUs not onlined with current mainline (was [PATCH 20/21] of: use for_each_of_cpu_node iterator) To: Michael Ellerman Cc: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Frank Rowand , chzigotzky@xenosoft.de 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, Oct 31, 2018 at 7:46 AM Michael Ellerman wrote: > > Hi Rob, > > This change is breaking some powerpc machines, ... > > Rob Herring writes: > > Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This > > has the side effect of defaulting to iterating using "cpu" node names in > > preference to the deprecated (for FDT) device_type == "cpu". > > > > Cc: Frank Rowand > > Cc: devicetree@vger.kernel.org > > Signed-off-by: Rob Herring > > --- > > Please ack and I will take via the DT tree. This is dependent on the > > first 2 patches. > > > > drivers/of/base.c | 2 +- > > drivers/of/of_numa.c | 15 ++------------- > > 2 files changed, 3 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/of/base.c b/drivers/of/base.c > > index 6389aeb2f48c..8285c07cab44 100644 > > --- a/drivers/of/base.c > > +++ b/drivers/of/base.c > > @@ -389,7 +389,7 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) > > { > > struct device_node *cpun; > > > > - for_each_node_by_type(cpun, "cpu") { > > + for_each_of_cpu_node(cpun) { > > if (arch_find_n_match_cpu_physical_id(cpun, cpu, thread)) > > return cpun; > > } > > Previously we just looked for any node with a type of "cpu", but now > we're using for_each_of_cpu_node(), which does: > > for (; next; next = next->sibling) { > if (!(of_node_name_eq(next, "cpu") || > (next->type && !of_node_cmp(next->type, "cpu")))) > continue; > > if (!__of_device_is_available(next)) > continue; > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > if (of_node_get(next)) > break; > } > > > ie. the available check is new. > > On this machine the 2nd CPU is not marked as available: > > root@p5020ds:/proc/device-tree/cpus/PowerPC,e5500@1# lsprop status > status "disabled" > > This has the effect of preventing the SMP code from finding the 2nd CPU > in order to bring it up (in smp_85xx_start_cpu()). And so only the boot > CPU is onlined. > > The device tree is built from a dts: > > arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi > > But we don't set the status in there, so presumably u-boot is changing > the status during boot? (not a u-boot expert). Ah, status for cpus is a bit different. For most nodes, it should be equivalent to the node not being present, but for cpus it means offline if disabled. Though ARM platforms have never used it in that way. > We could work around this in the platform code presumably, but I'm > worried this might break other things as well. You didn't mention the > addition of the available check in the change log so I wonder if it was > deliberate or just seemed like a good idea? Just seemed like a good idea... I'll send a patch now dropping those 2 lines. Rob