[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aPeTppUgRC1wWQU9@smile.fi.intel.com>
Date: Tue, 21 Oct 2025 17:07:34 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Herve Codina <herve.codina@...tlin.com>
Cc: Andrew Lunn <andrew@...n.ch>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Andi Shyti <andi.shyti@...nel.org>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Peter Rosin <peda@...ntia.se>, Arnd Bergmann <arnd@...db.de>,
Saravana Kannan <saravanak@...gle.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Charles Keepax <ckeepax@...nsource.cirrus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>,
David Rhodes <david.rhodes@...rus.com>,
Linus Walleij <linus.walleij@...aro.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Mark Brown <broonie@...nel.org>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Len Brown <lenb@...nel.org>, Davidlohr Bueso <dave@...olabs.net>,
Jonathan Cameron <jonathan.cameron@...wei.com>,
Dave Jiang <dave.jiang@...el.com>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Ira Weiny <ira.weiny@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Wolfram Sang <wsa@...nel.org>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, imx@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-pci@...r.kernel.org,
linux-sound@...r.kernel.org, patches@...nsource.cirrus.com,
linux-gpio@...r.kernel.org, linux-pm@...r.kernel.org,
linux-spi@...r.kernel.org, linux-acpi@...r.kernel.org,
linux-cxl@...r.kernel.org,
Allan Nielsen <allan.nielsen@...rochip.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>,
Steen Hegelund <steen.hegelund@...rochip.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v4 06/29] bus: Introduce simple-platorm-bus
On Wed, Oct 15, 2025 at 09:13:53AM +0200, Herve Codina wrote:
> The simple-pm-bus driver handles several simple busses. When it is used
> with busses other than a compatible "simple-pm-bus", it doesn't populate
> its child devices during its probe.
>
> This confuses fw_devlink and results in wrong or missing devlinks.
>
> Once a driver is bound to a device and the probe() has been called,
> device_links_driver_bound() is called.
>
> This function performs operation based on the following assumption:
> If a child firmware node of the bound device is not added as a
> device, it will never be added.
>
> Among operations done on fw_devlinks of those "never be added" devices,
> device_links_driver_bound() changes their supplier.
>
> With devices attached to a simple-bus compatible device, this change
> leads to wrong devlinks where supplier of devices points to the device
> parent (i.e. simple-bus compatible device) instead of the device itself
> (i.e. simple-bus child).
>
> When the device attached to the simple-bus is removed, because devlinks
> are not correct, its consumers are not removed first.
>
> In order to have correct devlinks created, make the simple-bus driver
> compliant with the devlink assumption and create its child devices
> during its probe.
>
> Doing that leads to other issues due to the fact that simple-bus is
> closely related to of_platform_populate().
>
> Indeed, of_platform_populate() can probe child devices if a simple-bus
> compatible node is detected. This behavior is expected by some drivers
> such as some MFD drivers. Those drivers perform some operations in their
> probe() but rely on the core (simple-mfd, simple-bus compatible) to
> populate child devices [1].
>
> Avoiding recursive probing in of_platform_populate() and let the
> simple-bus driver probe its child devices will break some system.
>
> For this reason, keep the current behavior of the simple-bus driver and
> of_platform_populate() as they are and introduce simple-platform-bus
> driver.
>
> This driver doesn't interfere with of_platform_populate() and populates
> child devices during its probe() as expected by fw_devlink.
>
> [1] https://lore.kernel.org/all/20250715095201.1bcb4ab7@bootlin.com/
Link tag?
...
The below is simply wrong. The luck that you got no errors is due to CONFIG_OF
being bool and not tristate in Kconfig. I dunno if this driver ever gets the
'm' capability, but currently it uses tons of dead code (such as MODULE_*()
macros). Disregard of that, the proposed change should go to the separate
compilation unit at bare minimum.
...
> module_platform_driver(simple_pm_bus_driver);
> +module_platform_driver(simple_platform_bus_driver);
^^^ WRONG!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists