[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240531-excursion-synapse-13c198fc61cb@spud>
Date: Fri, 31 May 2024 16:11:15 +0100
From: Conor Dooley <conor@...nel.org>
To: Rob Herring <robh@...nel.org>
Cc: Saravana Kannan <saravanak@...gle.com>,
Andreas Larsson <andreas@...sler.com>,
Sam Ravnborg <sam@...nborg.org>, sparclinux@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] of: WARN on using default root node
#address-cells/#size-cells
On Thu, May 30, 2024 at 07:33:57PM -0500, Rob Herring wrote:
> On Thu, May 30, 2024 at 2:21 PM Conor Dooley <conor@...nel.org> wrote:
> >
> > On Thu, May 30, 2024 at 01:50:48PM -0500, Rob Herring (Arm) wrote:
> > > While OpenFirmware originally allowed default values of #address-cells
> > > and #size-cells, FDT has long required explicit values. It's been a
> > > warning in dtc for the root node since the beginning (2005) and for
> > > any parent node since 2007. Of course, not all FDT uses dtc, but that
> > > should be the majority by far. The various extracted OF devicetrees I
> > > have dating back to the 1990s (various PowerMac, OLPC, PASemi Nemo)
> > > all have explicit root node properties.
> > >
> > > I have no idea what exists for Sparc, so disabling the warning for it.
> > > If any other platforms hit the warning, then the warning can be
> > > disabled for them.
> > >
> > > Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> > > ---
> > > Sparc folks, If anyone can dump DTs from some Sparc systems it would be
> > > helpful.
> > > ---
> > > drivers/of/base.c | 2 ++
> > > drivers/of/fdt.c | 2 ++
> > > 2 files changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/of/base.c b/drivers/of/base.c
> > > index 61fff13bbee5..6930aa29fec1 100644
> > > --- a/drivers/of/base.c
> > > +++ b/drivers/of/base.c
> > > @@ -96,6 +96,7 @@ int of_bus_n_addr_cells(struct device_node *np)
> > > return cells;
> > >
> > > /* No #address-cells property for the root node */
> > > + WARN_ONCE(!IS_ENABLED(CONFIG_SPARC), "Only listed platforms should rely on default '#address-cells'\n");
> >
> > I assume "listed platforms" means things in the first parameter of
> > WARN_ONCE()? Since that's only SPARC, why not just say it? The error
> > message is rather obtuse as-is I think.
>
> My intent is if you hit this warning, add the platform here.
Aye, I figured as much. My point was mostly that if you see this warning
during boot etc the message doesn't make that much sense. It only really
makes sense when you look at the kernel sources.
> I imagine
> it will be older stuff we can't or don't want to fix. Maybe I should
> just say that as a comment instead.
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists