From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21B13C0015E for ; Fri, 11 Aug 2023 21:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235338AbjHKVA3 (ORCPT ); Fri, 11 Aug 2023 17:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231634AbjHKVAX (ORCPT ); Fri, 11 Aug 2023 17:00:23 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37056E75 for ; Fri, 11 Aug 2023 14:00:23 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-40a47e8e38dso27061cf.1 for ; Fri, 11 Aug 2023 14:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691787622; x=1692392422; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dg6w6uZ0dRKMCs1yFFd5Ty/4oQw+/NVdYykf8kUdf9o=; b=lcFGBAp4zn3di2vpGU1cgvo1jIdiaYUPpUtRabRS6fAqG33cQc+OSKddzuDhJknceO 1x4podGW3ZZWsIHPvms81tYknU/ZJ1D8dF0r4HxKkS72+YQrRJ1vo155il/PjQdXjirK 09IbEEgNu+3T1yH9jt2XBFJiYVkkwKM5fNqR8jXd8c1wupsaHSXvBLoSeTVdghAeELlv s+0uxE2TblBkaS36uOpUoavh/CuJ94NIpevTYdqD5d1AKYnxHNr5yKQqv1x4YbHc0wj1 NMyA9OsGvtKYxEfvet3ZJxRUmrYZ47+w6c2vBdJjsiZm5bVg1Hs+kIP5OCjbtmSM97wo JRsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691787622; x=1692392422; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dg6w6uZ0dRKMCs1yFFd5Ty/4oQw+/NVdYykf8kUdf9o=; b=LyfUASPPGl3e5vggmKM0a84ncMBGWyLgtQ1TYMwKmF19hl4lWp8LfeG5K5Iv84yN+i Rn0WDLFEi/sIt+A+IvGqKoHxCx0Y0fJ6Ls6EFxVqZ0uStR/VVxk0DyMnq3UP7KYesn7J lF90wHh9bWuX0ONGJR90rIlPJF6dxZ7WYmWHchahIow+zsoVHbiw5DFvDcjGpoegElaB olp2x4waYYcosq9RawzuY3oYJl5RwpWMHbnOLpxexsavAQbkErdW0pB5/DTlDEmQmOl7 4o6n+oh/m2ghjcsS1VVKFJ2G6uKfKTQf17xc3A7x1eFQRtur8mn0b2d0xPZ3xpvj8/xe /zcg== X-Gm-Message-State: AOJu0YxvRhUK0TPrDvIiCtMa3hIKOmMOMXLxdLNhZa4HbI3s1WJVmuyj 4OR6Ddp984Omc7hDchc5EL+EufHSdVQTJp7q5+VQMw== X-Google-Smtp-Source: AGHT+IHHZ3nhL46CLGUvs4mMOWOUKG4JET9jKQEC1PVcb3KGxv0PigYsrkFmwn0CutRN32ifouOk/EgcVCoTLp5h/D0= X-Received: by 2002:a05:622a:10d:b0:3f4:f0fd:fe7e with SMTP id u13-20020a05622a010d00b003f4f0fdfe7emr273205qtw.3.1691787622264; Fri, 11 Aug 2023 14:00:22 -0700 (PDT) MIME-Version: 1.0 References: <20230802150018.327079-1-apatel@ventanamicro.com> <20230802150018.327079-3-apatel@ventanamicro.com> <20230811193924.GA3997669-robh@kernel.org> In-Reply-To: <20230811193924.GA3997669-robh@kernel.org> From: Saravana Kannan Date: Fri, 11 Aug 2023 13:59:46 -0700 Message-ID: Subject: Re: [PATCH v7 02/15] of: property: Add fw_devlink support for msi-parent To: Rob Herring Cc: Anup Patel , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Krzysztof Kozlowski , Frank Rowand , Conor Dooley , Atish Patra , Andrew Jones , Sunil V L , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Fri, Aug 11, 2023 at 12:39=E2=80=AFPM Rob Herring wrot= e: > > 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 > > --- > > 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(stru= ct device_node *np, > > return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.n= p; > > } > > > > +static struct device_node *parse_msi_parent(struct device_node *np, > > + const char *prop_name, int in= dex) > > +{ > > + 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 =3D 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=3DC2W+3pOWL36ZPme1LpHz5PEBVdKWv+kR7DYKmRy= w1AymMA@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[] =3D { > > { .parse_prop =3D parse_clocks, }, > > { .parse_prop =3D parse_interconnects, }, > > @@ -1359,6 +1390,7 @@ static const struct supplier_bindings of_supplier= _bindings[] =3D { > > { .parse_prop =3D parse_regulators, }, > > { .parse_prop =3D parse_gpio, }, > > { .parse_prop =3D parse_gpios, }, > > + { .parse_prop =3D parse_msi_parent, }, > > {} > > }; > > > > -- > > 2.34.1 > >