[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hTzrxqfejxSxqh9igiDp=8LkBw+FGSf9CJ7j3RyTJLBQ@mail.gmail.com>
Date: Wed, 2 Jul 2025 18:56:48 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sunil V L <sunilvl@...tanamicro.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
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>, 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 15/24] ACPI: property: Add support for cells property
On Wed, Jul 2, 2025 at 5:06 PM Sunil V L <sunilvl@...tanamicro.com> wrote:
>
> On Wed, Jul 02, 2025 at 02:39:30PM +0200, Rafael J. Wysocki wrote:
> > On Wed, Jul 2, 2025 at 1:38 PM Andy Shevchenko
> > <andriy.shevchenko@...ux.intel.com> wrote:
> > >
> > > On Wed, Jul 02, 2025 at 12:20:55PM +0200, Rafael J. Wysocki wrote:
> > > > On Wed, Jul 2, 2025 at 7:16 AM Anup Patel <apatel@...tanamicro.com> wrote:
> > >
> > > ...
> > >
> > > > > static int acpi_fwnode_get_reference_args(const struct fwnode_handle *fwnode,
> > > > > const char *propname, const char *nargs_prop,
> > > > > unsigned int args_count, unsigned int index,
> > >
> > > > > const struct acpi_device_data *data;
> > > > > struct fwnode_handle *ref_fwnode;
> > > > > struct acpi_device *device;
> > > > > + unsigned int nargs_count;
> > > > > int ret, idx = 0;
> > >
> > > > > + nargs_count = acpi_fwnode_get_args_count(device, nargs_prop);
> > > >
> > > > I think it should work the same way as it used to for the callers that
> > > > pass args_count, so maybe
> > > >
> > > > if (!args_count)
> > > > args_count = acpi_fwnode_get_args_count(device, nargs_prop);
> > >
> > > But this is different variable.
> >
> > Of course it is different. It is an acpi_fwnode_get_reference_args() parameter.
> >
> > > > > element++;
> > > > > -
> > > > > ret = acpi_get_ref_args(idx == index ? args : NULL,
> > > > > acpi_fwnode_handle(device),
> > > > > - &element, end, args_count);
> > > > > + &element, end,
> > > > > + nargs_count ? nargs_count : args_count);
> > > >
> > > > And this change would not be necessary?
> > >
> > > This is not the same check as proposed above.
> >
> > No, it is not.
> >
> > It just makes the function work the same way it did before the change
> > for the callers who passed nozero args_count and so they might be
> > forgiven expecting that it would be taken into account.
>
> But if we do like this, the expectation of
> fwnode_property_get_reference_args() will differ for DT and ACPI, right?
> I mean nargs_prop should take higher precedence than nargs.
So you basically want acpi_fwnode_get_reference_args() to take
nargs_prop into account (which could be explained much cleaner in the
patch changelogs).
Also, your changes don't modify the behavior of
__acpi_node_get_property_reference() AFAICS, so this is OK.
Never mind then, but you could pass nargs_prop along with the
additional device parameter to acpi_get_ref_args() and make that
function obtain the nargs_prop value. In the patch, you need to get
the nargs_prop value before calling it anyway in both places in which
it is used.
Powered by blists - more mailing lists