[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdV9EwBgmNYP9jZBZKNNn0ZX2XErcyeXu1xatFdBVzdXmw@mail.gmail.com>
Date: Tue, 16 Jul 2024 13:23:55 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Stephen Boyd <sboyd@...nel.org>
Cc: Michael Turquette <mturquette@...libre.com>, linux-kernel@...r.kernel.org,
linux-clk@...r.kernel.org, patches@...ts.linux.dev,
kunit-dev@...glegroups.com, linux-kselftest@...r.kernel.org,
devicetree@...r.kernel.org, Brendan Higgins <brendan.higgins@...ux.dev>,
David Gow <davidgow@...gle.com>, Rae Moar <rmoar@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J . Wysocki" <rafael@...nel.org>,
Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>,
Daniel Latypov <dlatypov@...gle.com>, Christian Marangi <ansuelsmth@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
Maxime Ripard <maxime@...no.tech>, Peter Rosin <peda@...ntia.se>,
Wolfram Sang <wsa+renesas@...g-engineering.com>, Linux I2C <linux-i2c@...r.kernel.org>
Subject: Re: [PATCH v7 1/8] of/platform: Allow overlays to create platform
devices from the root node
On Tue, Jul 16, 2024 at 11:48 AM Geert Uytterhoeven
<geert@...ux-m68k.org> wrote:
> On Wed, Jul 10, 2024 at 10:14 PM Stephen Boyd <sboyd@...nel.org> wrote:
> > We'd like to apply overlays to the root node in KUnit so we can test
> > platform devices created as children of the root node.
> >
> > On some architectures (powerpc), the root node isn't marked with
> > OF_POPULATED_BUS. If an overlay tries to modify the root node on these
> > platforms it will fail, while on other platforms, such as ARM, it will
> > succeed. This is because the root node is marked with OF_POPULATED_BUS
> > by of_platform_default_populate_init() calling
> > of_platform_default_populate() with NULL as the first argument.
> >
> > Loosen the requirement here so that platform devices can be created for
> > nodes created as children of the root node via DT overlays even if the
> > platform bus wasn't populated for the root node.
> >
> > Reviewed-by: Rob Herring (Arm) <robh@...nel.org>
> > Cc: Saravana Kannan <saravanak@...gle.com>
> > Signed-off-by: Stephen Boyd <sboyd@...nel.org>
> > --- a/drivers/of/platform.c
> > +++ b/drivers/of/platform.c
> > @@ -732,11 +732,14 @@ static int of_platform_notify(struct notifier_block *nb,
> > struct of_reconfig_data *rd = arg;
> > struct platform_device *pdev_parent, *pdev;
> > bool children_left;
> > + struct device_node *parent;
> >
> > switch (of_reconfig_get_state_change(action, rd)) {
> > case OF_RECONFIG_CHANGE_ADD:
> > - /* verify that the parent is a bus */
> > - if (!of_node_check_flag(rd->dn->parent, OF_POPULATED_BUS))
> > + parent = rd->dn->parent;
> > + /* verify that the parent is a bus (or the root node) */
> > + if (!of_node_is_root(parent) &&
> > + of_node_check_flag(parent, OF_POPULATED_BUS))
>
> Oh, you inverted the check for of_node_check_flag(); was that
> intentional? Re-adding the "!" fixes all issues for me.
I have sent a fix.
https://lore.kernel.org/a9ada686e1f1c6f496e423deaf108f1bcfd94d7d.1721123679.git.geert+renesas@glider.be/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
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
Powered by blists - more mailing lists