Re: [PATCH 2/2] of: Warn when of_property_read_bool() is used on non-boolean properties

From: Geert Uytterhoeven
Date: Wed Jan 15 2025 - 06:21:08 EST


On Tue, Jan 14, 2025 at 8:19 PM Rob Herring <robh@xxxxxxxxxx> wrote:
> On Tue, Jan 14, 2025 at 12:35 PM Geert Uytterhoeven
> <geert@xxxxxxxxxxxxxx> wrote:
> > On Thu, Jan 9, 2025 at 8:42 PM Rob Herring (Arm) <robh@xxxxxxxxxx> wrote:
> > > The use of of_property_read_bool() for non-boolean properties is
> > > deprecated. The primary use of it was to test property presence, but
> > > that has been replaced in favor of of_property_present(). With those
> > > uses now fixed, add a warning to discourage new ones.
> > >
> > > Signed-off-by: Rob Herring (Arm) <robh@xxxxxxxxxx>
> >
> > Thanks for your patch, which is now commit c141ecc3cecd7647 ("of:
> > Warn when of_property_read_bool() is used on non-boolean properties")
> > in dt-rh/for-next.
> >
> > I have bisected a failure in secondary CPU bring-up on R-Car H1 (quad
> > Cortex-A9 MPCore) to this commit:
> >
> > Detected Renesas R-Car Gen1 r8a7779 ES1.0
> > smp: Bringing up secondary CPUs ...
> > -CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
> > -CPU1: Spectre v2: using BPIALL workaround
> > -CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
> > -CPU2: Spectre v2: using BPIALL workaround
> > -CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
> > -CPU3: Spectre v2: using BPIALL workaround
> > -smp: Brought up 1 node, 4 CPUs
> > -SMP: Total of 4 processors activated (2000.00 BogoMIPS).
> > +CPU1: failed to come online
> > +CPU2: failed to come online
> > +CPU3: failed to come online
> > +smp: Brought up 1 node, 1 CPU
> > +SMP: Total of 1 processors activated (500.00 BogoMIPS).
> > CPU: All CPU(s) started in SVC mode.
> >
> > Reverting this commit on top of my work tree fixes the issue, too.
> > However, I do not see how this commit could impact CPU bring-up?
>
> Strange. Perhaps the of_property_read_bool was inlined into some
> special section before?

I re-added the old inline of_property_read_bool(), but with a different
name. CPU bringup starts working again if I replace at least one call
to of_property_read_bool() in arch/arm/mm/cache-l2x0.c:aurora_of_parse()
by a call to the inline variant, or even if I just add

pr_info("xf_property_read_bool(np, \"wt-override\") = %d\n",
xf_property_read_bool(np, "wt-override"));

to that function. Note that that function is not called at all on my platform.

This small change causes quite some reordering in arch/arm/mm/cache-l2x0.s,
so it looks like a layout issue. More analysis will follow...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds