[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGETcx8d-VfOewKAMX6aksx9e-_eaWOtU=7i3R624-B-aStBQA@mail.gmail.com>
Date: Fri, 11 Aug 2023 13:59:46 -0700
From: Saravana Kannan <saravanak@...gle.com>
To: Rob Herring <robh@...nel.org>
Cc: Anup Patel <apatel@...tanamicro.com>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Frank Rowand <frowand.list@...il.com>,
Conor Dooley <conor+dt@...nel.org>,
Atish Patra <atishp@...shpatra.org>,
Andrew Jones <ajones@...tanamicro.com>,
Sunil V L <sunilvl@...tanamicro.com>,
Anup Patel <anup@...infault.org>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v7 02/15] of: property: Add fw_devlink support for msi-parent
On Fri, Aug 11, 2023 at 12:39 PM Rob Herring <robh@...nel.org> wrote:
>
> On Wed, Aug 02, 2023 at 08:30:05PM +0530, Anup Patel wrote:
> > This allows fw_devlink to create device links between consumers of
> > a MSI and the supplier of the MSI.
> >
> > Signed-off-by: Anup Patel <apatel@...tanamicro.com>
> > ---
> > drivers/of/property.c | 32 ++++++++++++++++++++++++++++++++
> > 1 file changed, 32 insertions(+)
> >
> > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > index ddc75cd50825..bc20535deed7 100644
> > --- a/drivers/of/property.c
> > +++ b/drivers/of/property.c
> > @@ -1325,6 +1325,37 @@ static struct device_node *parse_interrupts(struct device_node *np,
> > return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np;
> > }
> >
> > +static struct device_node *parse_msi_parent(struct device_node *np,
> > + const char *prop_name, int index)
> > +{
> > + struct of_phandle_args sup_args;
> > + struct device_node *msi_np;
> > +
> > + if (IS_ENABLED(CONFIG_SPARC))
> > + return NULL;
> > +
> > + if (strcmp(prop_name, "msi-parent"))
> > + return NULL;
> > +
> > + msi_np = of_parse_phandle(np, prop_name, 0);
> > + if (msi_np) {
> > + if (!of_property_read_bool(msi_np, "#msi-cells")) {
>
> Use of_property_present() to check presence.
>
> However, this check is wrong. #msi-cells is optional and assumed to be 0
> if not present. There's another flavor of of_parse_phandle_with_args()
> that allows specifying a default cell count, so I think you can get rid
> of all this checking.
Rob,
The existing DEFINE_SIMPLE_PROP() already does this btw. See commit
ff24fed10ba41. Anup just ignores review comments.
Anup,
Saw your reply here:
https://lore.kernel.org/lkml/CAK9=C2W+3pOWL36ZPme1LpHz5PEBVdKWv+kR7DYKmRyw1AymMA@mail.gmail.com/
Did you even try the macro? Why are you so hell bent on wasting our
time by ignoring code review comments and sending the same useless
patch?
-Saravana
>
> > + if (index) {
> > + of_node_put(msi_np);
> > + return NULL;
> > + }
> > + return msi_np;
> > + }
> > + of_node_put(msi_np);
> > + }
> > +
> > + if (of_parse_phandle_with_args(np, prop_name, "#msi-cells", index,
> > + &sup_args))
> > + return NULL;
> > +
> > + return sup_args.np;
> > +}
> > +
> > static const struct supplier_bindings of_supplier_bindings[] = {
> > { .parse_prop = parse_clocks, },
> > { .parse_prop = parse_interconnects, },
> > @@ -1359,6 +1390,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
> > { .parse_prop = parse_regulators, },
> > { .parse_prop = parse_gpio, },
> > { .parse_prop = parse_gpios, },
> > + { .parse_prop = parse_msi_parent, },
> > {}
> > };
> >
> > --
> > 2.34.1
> >
Powered by blists - more mailing lists