[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201020133254.GC843@valkosipuli.retiisi.org.uk>
Date: Tue, 20 Oct 2020 16:32:56 +0300
From: Sakari Ailus <sakari.ailus@....fi>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: Daniel Scally <djrscally@...il.com>, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux.walleij@...aro.org,
prabhakar.mahadev-lad.rj@...renesas.com,
heikki.krogerus@...ux.intel.com, dmitry.torokhov@...il.com,
laurent.pinchart+renesas@...asonboard.com,
kieran.bingham+renesas@...asonboard.com, jacopo+renesas@...ndi.org,
robh@...nel.org, davem@...emloft.net, linux@...musvillemoes.dk,
andriy.shevchenko@...ux.intel.com, sergey.senozhatsky@...il.com,
rostedt@...dmis.org, pmladek@...e.com, mchehab@...nel.org,
tian.shu.qiu@...el.com, bingbu.cao@...el.com, yong.zhi@...el.com,
rafael@...nel.org, gregkh@...uxfoundation.org, kitakar@...il.com,
dan.carpenter@...cle.org
Subject: Re: [RFC PATCH v3 4/9] software_node: Add support for
fwnode_graph*() family of functions
On Tue, Oct 20, 2020 at 03:35:56PM +0300, Sakari Ailus wrote:
> Hi Daniel, Heikki,
>
> Thanks for the patch.
>
> On Mon, Oct 19, 2020 at 11:58:58PM +0100, Daniel Scally wrote:
> > From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> >
> > This implements the remaining .graph_* callbacks in the
> > fwnode operations vector for the software nodes. That makes
> > the fwnode_graph*() functions available in the drivers also
> > when software nodes are used.
> >
> > The implementation tries to mimic the "OF graph" as much as
> > possible, but there is no support for the "reg" device
> > property. The ports will need to have the index in their
> > name which starts with "port" (for example "port0", "port1",
> > ...) and endpoints will use the index of the software node
> > that is given to them during creation. The port nodes can
> > also be grouped under a specially named "ports" subnode,
> > just like in DT, if necessary.
> >
> > The remote-endpoints are reference properties under the
> > endpoint nodes that are named "remote-endpoint".
> >
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> > Co-developed-by: Daniel Scally <djrscally@...il.com>
> > Signed-off-by: Daniel Scally <djrscally@...il.com>
> > ---
> > changes in v3:
> > - removed software_node_device_is_available
> > - moved the change to software_node_get_next_child to a separate
> > patch
> > - switched to use fwnode_handle_put() in graph_get_next_endpoint()
> > instead of software_node_put()
> >
> > changes in v2:
> > - added software_node_device_is_available
> > - altered software_node_get_next_child to get references
> > - altered software_node_get_next_endpoint to release references
> > to ports and avoid passing invalid combinations of swnodes to
> > software_node_get_next_child
> > - altered swnode_graph_find_next_port to release port rather than
> > old
> > drivers/base/swnode.c | 120 +++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 119 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> > index 741149b90..3732530ce 100644
> > --- a/drivers/base/swnode.c
> > +++ b/drivers/base/swnode.c
> > @@ -536,6 +536,120 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode,
> > return 0;
> > }
> >
> > +static struct fwnode_handle *
> > +swnode_graph_find_next_port(const struct fwnode_handle *parent,
> > + struct fwnode_handle *port)
> > +{
> > + struct fwnode_handle *old = port;
> > +
> > + while ((port = software_node_get_next_child(parent, old))) {
>
> software_node_get_next_child() doesn't drop the reference of the old child
> nor gets a reference to the returned node. Should it?
>
> The function to get a named child node does.
>
> It'd be nice if this was aligned. Or am I missing something?
>
> This isn't really a comment on this patch though.
I didn't get this patch to my @linux.intel.com account so I guess it's our
mail servers again...
Anyway, please see my comments on that and ignore this one.
--
Sakari Ailus
Powered by blists - more mailing lists