[PATCH v2] treewide: Fix instantiation of devices in DT overlays
Ivan Bornyakov
i.bornyakov at metrotek.ru
Mon Mar 27 01:54:01 PDT 2023
Hi, Shawn!
On Mon, Mar 27, 2023 at 11:02:13AM +0800, Shawn Guo wrote:
> + Ivan
>
> On Fri, Mar 24, 2023 at 10:30:39AM +0100, Geert Uytterhoeven wrote:
> > When loading a DT overlay that creates a device, the device is not
> > instantiated, unless the DT overlay is unloaded and reloaded again.
> >
> > Saravana explains:
> > Basically for all overlays (I hope the function is only used for
> > overlays) we assume all nodes are NOT devices until they actually
> > get added as a device.
> >
> > Based on a patch by Saravana Kannan, which covered only platform and spi
> > devices.
> >
> > Fixes: 4a032827daa89350 ("of: property: Simplify of_link_to_phandle()")
> > Link: https://lore.kernel.org/r/CAGETcx_+rhHvaC_HJXGrr5_WAd2+k5f=rWYnkCZ6z5bGX-wj4w@mail.gmail.com
> > Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
> > Acked-by: Mark Brown <broonie at kernel.org>
> > ---
> > v2:
> > - Add Acked-by,
> > - Drop RFC.
> > ---
> > drivers/bus/imx-weim.c | 1 +
> > drivers/i2c/i2c-core-of.c | 1 +
> > drivers/of/dynamic.c | 1 +
> > drivers/of/platform.c | 1 +
> > drivers/spi/spi.c | 1 +
> > 5 files changed, 5 insertions(+)
> >
> > diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
> > index 36d42484142aede2..898e23a4231400fa 100644
> > --- a/drivers/bus/imx-weim.c
> > +++ b/drivers/bus/imx-weim.c
> > @@ -329,6 +329,7 @@ static int of_weim_notify(struct notifier_block *nb, unsigned long action,
> > "Failed to setup timing for '%pOF'\n", rd->dn);
> >
> > if (!of_node_check_flag(rd->dn, OF_POPULATED)) {
> > + rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE;
> > if (!of_platform_device_create(rd->dn, NULL, &pdev->dev)) {
> > dev_err(&pdev->dev,
> > "Failed to create child device '%pOF'\n",
>
> Ivan, so you were aware of that the device is not instantiated before
> this change?
>
I was not aware of that, thanks for warning me.
Will test in the near future.
More information about the linux-arm-kernel
mailing list