[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iYjc2JurNAJyr1o03Mr7DJyc=MdHvbTsCsC76JR0suNQ@mail.gmail.com>
Date: Wed, 2 Jul 2025 19:01:27 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sunil V L <sunilvl@...tanamicro.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Anup Patel <apatel@...tanamicro.com>,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Jassi Brar <jassisinghbrar@...il.com>, Thomas Gleixner <tglx@...utronix.de>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>,
Uwe Kleine-König <ukleinek@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>, Paul Walmsley <paul.walmsley@...ive.com>,
Alexandre Ghiti <alex@...ti.fr>, Len Brown <lenb@...nel.org>, Rahul Pathak <rpathak@...tanamicro.com>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>, Atish Patra <atish.patra@...ux.dev>,
Andrew Jones <ajones@...tanamicro.com>, Samuel Holland <samuel.holland@...ive.com>,
Anup Patel <anup@...infault.org>, linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
linux-acpi@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 14/24] ACPI: property: Refactor acpi_fwnode_get_reference_args()
On Wed, Jul 2, 2025 at 4:45 PM Sunil V L <sunilvl@...tanamicro.com> wrote:
>
> On Wed, Jul 02, 2025 at 12:07:36PM +0200, Rafael J. Wysocki wrote:
> > On Wed, Jul 2, 2025 at 7:15 AM Anup Patel <apatel@...tanamicro.com> wrote:
> > >
> > > From: Sunil V L <sunilvl@...tanamicro.com>
> > >
> > > Currently acpi_fwnode_get_reference_args() calls the public function
> > > __acpi_node_get_property_reference() which ignores the nargs_prop
> > > parameter.
> >
> > Which I suppose is a problem. Why is it so?
> >
> fwnode_property_get_reference_args() documents as below.
>
> * @nargs_prop: The name of the property telling the number of
> * arguments in the referred node. NULL if @nargs is known,
> * otherwise @nargs is ignored. Only relevant on OF.
> * @nargs: Number of arguments. Ignored if @nargs_prop is non-NULL.
>
> You can see that nargs_prop is not supported with ACPI currently. Since
> fwnode_property_get_reference_args() calls
> __acpi_node_get_property_reference(), there is no way to determine the
> nargs from the nargs_prop currently with ACPI. Since
> fwnode_property_get_reference_args() is a common API across DT and ACPI,
> it is a problem for users.
So the problem is that if nargs_prop is passed to
fwnode_property_get_reference_args() and it is a valid "cells"
property, OF will use it to obtain the number of reference arguments
and ACPI will ignore it. To make it work the same way in both cases,
acpi_fwnode_get_reference_args() needs to be modified to take
nargs_prop into account properly. This is the key information that
needs to go into the patch changelog.
> > > To fix this, make __acpi_node_get_property_reference() to
> > > call the static acpi_fwnode_get_reference() so that callers of
> > > fwnode_get_reference_args() can still pass a valid property name to
> > > fetch the number of arguments.
> >
> > Are the current callers of acpi_fwnode_get_reference_args() going to
> > be affected by this change and if so, then how?
> >
> Good question!. If some one is currently passing both valid nargs_prop and
> nargs with ACPI, now with this change it will start getting the value
> from nargs_prop which was simply ignored earlier. However, I see only 2
> combinations how fwnode_property_get_reference_args() is being used.
>
> (nargs_prop = NULL) && (args_count !=0)
> or
> (nargs_prop != NULL) && (args_count = 0)
OK
Powered by blists - more mailing lists