Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp677402imd; Thu, 1 Nov 2018 03:56:19 -0700 (PDT) X-Google-Smtp-Source: AJdET5eUQQKnEWHUex8Ji+kO8grK3l1tG563Go87yHElAGyrF5htZP4CSKovk60dk44vI7Db43f+ X-Received: by 2002:aa7:8195:: with SMTP id g21-v6mr7225727pfi.71.1541069779764; Thu, 01 Nov 2018 03:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541069779; cv=none; d=google.com; s=arc-20160816; b=ee2N88r48lPTmVdZU2Lzs+njDp4Bs4W2OwFax6dNmmQFzfZeI+BbGYOkI0ty+3emPJ Xawtfm0QYqDSDm7D3Ts9Y/RsiH/FssVeznh04GDdhdIb1hHkV2ehx8KkH4dD7KAphsMW Zdn33ooGM2HXaK8Dd3+EHuqk+dgJgoHB1leDEv8DSIIgknshIvRFw/a8vd4TB61K2+VF QAElrmFhuR5m5Qsl6T1vgUH+O1yMtcXvWxutWOaZnKhpCtqfsxX+X7xDpVXjVO0XMx2c BPFV3TMTJ9jCXMLKRZkMtSgPpDRYgvnCzsiKYohXmsitTsaChxdaII0vSDZMjEwj9PwV F1CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=RFcJqE49Ecski+tU6U1uuFrHBob3Z2/QoWphuzab8Sg=; b=u1HouvvMPqXrumfgDjtT2XiwQsxNNU5yxh9233020xNZKGTWVYA4fbeeuiamuj9eVT 1/A1QKKtke7fLmGsZ4fqh9aOmUPO99T2pk1w2sXxBNhou3rEEiDM4cjEM5qncFZWJVpR G7Qv9eFLIDJGaAVCbiOvDvn3AQL1IEiBUpEnHhznxIb6a1MLSWyfqh47Gk2BcwegyPcB SNdTyx6WL8qRFYCuTQaHk39PuZ5Fi06w0YNF60B0w+WbN2iuYxSW48iJFPerW9f1uAa4 fmkWHwPeNmjqpLprf5a2zTLrK40D+dHxQAtK4aiNixXQje0DkImgzGnYQy3/saEkLq/h YRTg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg12-v6si29480183plb.319.2018.11.01.03.56.03; Thu, 01 Nov 2018 03:56:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbeKAT6J (ORCPT + 99 others); Thu, 1 Nov 2018 15:58:09 -0400 Received: from ozlabs.org ([203.11.71.1]:52629 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbeKAT6I (ORCPT ); Thu, 1 Nov 2018 15:58:08 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42m2DW30HCzB4N2; Thu, 1 Nov 2018 21:55:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Rob Herring Cc: devicetree@vger.kernel.org, "linux-kernel\@vger.kernel.org" , Frank Rowand , chzigotzky@xenosoft.de Subject: Re: NXP P50XX/e5500 secondary CPUs not onlined with current mainline (was [PATCH 20/21] of: use for_each_of_cpu_node iterator) In-Reply-To: References: <20180905193738.19325-1-robh@kernel.org> <20180905193738.19325-21-robh@kernel.org> <87r2g6ffm8.fsf@concordia.ellerman.id.au> Date: Thu, 01 Nov 2018 21:55:38 +1100 Message-ID: <87r2g5dq39.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rob Herring writes: > On Wed, Oct 31, 2018 at 7:46 AM Michael Ellerman wrote: >> 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. Aha. We don't use it like that on server CPUs either, so perhaps it's just a u-boot thing. >> 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... Yeah fair enough. > I'll send a patch now dropping those 2 lines. Awesome, thanks. cheers