Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4735925imm; Tue, 11 Sep 2018 17:15:53 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb8jVSOvgo9MRoU6Ih1K6qkkZKwnRichGxDmUgtZAVnyepXMmyrVHjtt4HDcRCHJ9BcqY9r X-Received: by 2002:a63:f4b:: with SMTP id 11-v6mr31382127pgp.100.1536711353490; Tue, 11 Sep 2018 17:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536711353; cv=none; d=google.com; s=arc-20160816; b=QqEs8deENtoams6gZNVeudtzaZSDH5+NFBO61RffAtZFVmb6aNTatMdOMjXiTumSYn cq3/dATRghe2GAgJF45rlodPLXdN347q/OuANuYp/A1cnw6LQxXGmzKLcyFSRTHjfDLM 4AnbvnINLx0kJTqMl8sMnLAx+v7j0DBX6cEUyw7TJfahWTcGcWmSEIVyqEsOd070LNSf CrANeauL+opfEAThf3kF8HX8vzo2ugHXrLmKi6EjlaGXLjq61KH8M53+5yiwaGAiZmHS 4MdOMRUwI19OIRPtdKn1h/GJ6nmLLsOKADYJQ+miVb6H4tvWgxhFWJ15AeZlKDNOp61t 477g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:mime-version:references:message-id :in-reply-to:subject:cc:from:date; bh=KAwQZ9y2KMCnOMDY+x5DGmsKUyytKqSzaZgFmka9EOw=; b=CS3Yiy+rq+Jyy4ibkOaPHOwZ6mXBRd/ci9COEsg29TUuE/JqLkT0+/JouBbaAh/1ZX R6bhhtD+aX14kYBo/zD2h6+Fp9AX4Rovfxq38uvXyoAkFDpeKb1o0qhok4LpTN7aAlTj g0LO/MU7TnSeHF4y3pBwio+bQIyJ9C9LgGC+i5qOCGs3xmYwFaSkwSHMKNQTA4xnnloi UkeNIPcJMO4sUVoyAlazKf27s/JJ4CG5qnh4y/FWUNlP5DVaKXWsgRffENFlJtt2d8jw 1gmZ1OZ4ZRZojMCw+DzVCCSO15EfPzlbbJf5lbAu4dhWS/1rGwtINm5f0GgdTnoIkURN nWhQ== 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 33-v6si19298224plk.300.2018.09.11.17.15.37; Tue, 11 Sep 2018 17:15:53 -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 S1726502AbeILFQ5 (ORCPT + 99 others); Wed, 12 Sep 2018 01:16:57 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:51458 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725738AbeILFQ5 (ORCPT ); Wed, 12 Sep 2018 01:16:57 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id CF5352A7CE; Tue, 11 Sep 2018 20:15:07 -0400 (EDT) Date: Wed, 12 Sep 2018 10:15:23 +1000 (AEST) From: Finn Thain cc: Frank Rowand , Stan Johnson , Rob Herring , Benjamin Herrenschmidt , Chintan Pandya , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: v4.17 regression: PowerMac G3 won't boot, was Re: [PATCH v5 1/3] of: cache phandle nodes to reduce cost of of_find_node_by_phandle() In-Reply-To: Message-ID: References: <1520208889-3908-1-git-send-email-frowand.list@gmail.com> <1520208889-3908-2-git-send-email-frowand.list@gmail.com> <0ad5dbfd-08f3-b97d-34b9-70fc9a729921@gmail.com> <7427daf6570d519e6793eb96d2fbaa52714b0cd7.camel@kernel.crashing.org> <20180910125320.GA17028@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [The Cc list got pruned so I'm forwarding Stan's reply for the benefit of the list archives and any other interested parties.] On Mon, 10 Sep 2018, Stan Johnson wrote: > On 9/10/18 6:53 AM, Rob Herring wrote: > > > ... > > Can you try this patch (w/o Ben's patch). I think the problem is if > > there are no phandles, then roundup_pow_of_two is passed 0 which is > > documented as undefined result. > > > > Though, if a DT has no properties with phandles, then why are we doing a > > lookup in the first place? > > > > > > 8<---------------------------------------------------------------------- > > > > diff --git a/drivers/of/base.c b/drivers/of/base.c > > index 9095b8290150..74eaedd5b860 100644 > > --- a/drivers/of/base.c > > +++ b/drivers/of/base.c > > @@ -140,6 +140,9 @@ void of_populate_phandle_cache(void) > > if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL) > > phandles++; > > > > + if (!phandles) > > + goto out; > > + > > cache_entries = roundup_pow_of_two(phandles); > > phandle_cache_mask = cache_entries - 1; > > > > Using the attached .config file, I first compiled the stock 4.18 > kernel from kernel.org; it hung at the Mac OS background screen > on my Beige G3 Desktop using the BootX extension and the BootX.app > from within MacOS. I then applied the above patch, and it booted > without any problems from both the BootX extension and using the > BootX.app from within MacOS. > > -Stan > >