[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201021093759.GE843@valkosipuli.retiisi.org.uk>
Date: Wed, 21 Oct 2020 12:37:59 +0300
From: Sakari Ailus <sakari.ailus@....fi>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Dan 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,
sergey.senozhatsky@...il.com, rostedt@...dmis.org,
pmladek@...e.com, mchehab@...nel.org, tian.shu.qiu@...el.com,
bingbu.cao@...el.com, sakari.ailus@...ux.intel.com,
yong.zhi@...el.com, rafael@...nel.org, gregkh@...uxfoundation.org,
kitakar@...il.com, dan.carpenter@...cle.org
Subject: Re: [RFC PATCH v3 3/9] software_node: Fix failure to hold refcount
in software_node_get_next_child
On Wed, Oct 21, 2020 at 12:33:21PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 21, 2020 at 12:25:28AM +0100, Dan Scally wrote:
> > On 20/10/2020 14:31, Sakari Ailus wrote:
> > > On Mon, Oct 19, 2020 at 11:58:57PM +0100, Daniel Scally wrote:
>
> > >> + return software_node_get(&c->fwnode);
> > > I believe similarly, the function should drop the reference to the previous
> > > node, and not expect the caller to do this. The OF equivalent does the
> > > same.
> >
> > I think I prefer it this way myself, since the alternative is having to
> > explicitly call *_node_get() on a returned child if you want to keep it
> > but also keep iterating. But I agree that it's important to take a
> > consistent approach. I'll add that too; this will mean
> > swnode_graph_find_next_port() and
> > software_node_graph_get_next_endpoint() in patch 4 of this series will
> > need changing slightly to square away their references.
>
> What about ACPI case? Does it square?
In ACPI, we seem to assume these nodes are always there and thus don't need
reference counting.
--
Sakari Ailus
Powered by blists - more mailing lists