Re: [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only

Sakari Ailus
2025-09-26T06:18:30Z

Hi Dmitry,

On Wed, Sep 24, 2025 at 11:32:56AM -0700, Dmitry Torokhov wrote:
> Hi Sakari,
>
> On Wed, Sep 24, 2025 at 10:45:48AM +0300, Sakari Ailus wrote:
> > Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
> > property API is somewhat problematic as the latter is used in the
>
> How exactly is this problematic?

In general, the fwnode property API is implemented by the (currently three)
backends so the backend calling fwnode property API to call itself without
knowing what exactly gets called may end up in an infinite recursion.
Keeping ACPI implementation separate from the fwnode property frontend
avoids even needing to think about this.

>
> > impelementation of the former. Instead of using
> > fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
> > acpi_get_next_subnode() directly instead.
>
> I think we are moving into the world of mixed fwnode types with software
> nodes/secondary fwnodes, so I do not think this is a step in right
> direction.

This is not how it works. If you have an ACPI node, it's and ACPI node, not
a software node or an OF node. A software node would be attached as
fwnode->secondary, it's not the same ACPI (device or data) node.

--
Regards,

Sakari Ailus