Re: [PATCH v2] treewide: Fix instantiation of devices in DT overlays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> > Acked-by: Mark Brown <broonie@xxxxxxxxxx>
> > ---
> > 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.




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux