[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.21.1809121015070.137@nippy.intranet>
Date: Wed, 12 Sep 2018 10:15:23 +1000 (AEST)
From: Finn Thain <fthain@...egraphics.com.au>
To: unlisted-recipients:; (no To-header on input)
cc: Frank Rowand <frank.rowand@...y.com>,
Stan Johnson <userm57@...oo.com>,
Rob Herring <robh+dt@...nel.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Chintan Pandya <cpandya@...eaurora.org>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.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()
[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
>
>
Powered by blists - more mailing lists