lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 6 Apr 2023 07:01:40 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Rob Herring <robh@...nel.org>
Cc:     Geert Uytterhoeven <geert+renesas@...der.be>,
        Mark Brown <broonie@...nel.org>, devicetree@...r.kernel.org,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Saravana Kannan <saravanak@...gle.com>,
        Ivan Bornyakov <i.bornyakov@...rotek.ru>,
        Fabio Estevam <festevam@...il.com>, linux-i2c@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        Frank Rowand <frowand.list@...il.com>,
        Shawn Guo <shawnguo@...nel.org>, linux-kernel@...r.kernel.org,
        linux-spi@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
        NXP Linux Team <linux-imx@....com>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Wolfram Sang <wsa@...nel.org>
Subject: Re: [PATCH v3] treewide: Fix probing of devices in DT overlays

On Wed, Apr 05, 2023 at 03:42:52PM -0500, Rob Herring wrote:
> 
> On Thu, 30 Mar 2023 15:26:13 +0200, Geert Uytterhoeven wrote:
> > When loading a DT overlay that creates a device, the device is not
> > probed, unless the DT overlay is unloaded and reloaded again.
> > 
> > After the recent refactoring to improve fw_devlink, it no longer depends
> > on the "compatible" property to identify which device tree nodes will
> > become struct devices.   fw_devlink now picks up dangling consumers
> > (consumers pointing to descendent device tree nodes of a device that
> > aren't converted to child devices) when a device is successfully bound
> > to a driver.  See __fw_devlink_pickup_dangling_consumers().
> > 
> > However, during DT overlay, a device's device tree node can have
> > sub-nodes added/removed without unbinding/rebinding the driver.  This
> > difference in behavior between the normal device instantiation and
> > probing flow vs. the DT overlay flow has a bunch of implications that
> > are pointed out elsewhere[1].  One of them is that the fw_devlink logic
> > to pick up dangling consumers is never exercised.
> > 
> > This patch solves the fw_devlink issue by marking all DT nodes added by
> > DT overlays with FWNODE_FLAG_NOT_DEVICE (fwnode that won't become
> > device), and by clearing the flag when a struct device is actually
> > created for the DT node.  This way, fw_devlink knows not to have
> > consumers waiting on these newly added DT nodes, and to propagate the
> > dependency to an ancestor DT node that has the corresponding struct
> > device.
> > 
> > Based on a patch by Saravana Kannan, which covered only platform and spi
> > devices.
> > 
> > [1] https://lore.kernel.org/r/CAGETcx_bkuFaLCiPrAWCPQz+w79ccDp6=9e881qmK=vx3hBMyg@mail.gmail.com
> > 
> > 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@...der.be>
> > Acked-by: Mark Brown <broonie@...nel.org>
> > Acked-by: Wolfram Sang <wsa@...nel.org> # for I2C
> > ---
> > v3:
> >   - Add Acked-by,
> >   - s/instantiate/probe/,
> >   - Improve commit description,
> >   - Add comment before clearing FWNODE_FLAG_NOT_DEVICE,
> > 
> > v2:
> >   - Add Acked-by,
> >   - Drop RFC.
> > ---
> >  drivers/bus/imx-weim.c    | 6 ++++++
> >  drivers/i2c/i2c-core-of.c | 5 +++++
> >  drivers/of/dynamic.c      | 1 +
> >  drivers/of/platform.c     | 5 +++++
> >  drivers/spi/spi.c         | 5 +++++
> >  5 files changed, 22 insertions(+)
> > 
> 
> Applied, thanks!

Oops, I thought I had to take this.  I'll go drop it from my tree...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ