Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4549409pxu; Tue, 20 Oct 2020 22:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8CXwr2SjtNPZ3F3Ac7PPq+r2B0+COYQha/wmsOEEcDcPFB4QWY8/CehQgfbpaLx7nWw/R X-Received: by 2002:a17:906:a387:: with SMTP id k7mr1698381ejz.167.1603256904647; Tue, 20 Oct 2020 22:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603256904; cv=none; d=google.com; s=arc-20160816; b=nk8j45l9Urqi1yrdRBJghVIAtEveRjnlAdukEcLoEmLTVA+i/QnmqSahQ5SHmlP9xc FZcYQozQd7OpWcXtbRA58utlEk7GeC5hxyeRqb75J17ev4vjDrF8dQ9pA5zA13M6rthe L4AEIpENE2EmyVQTIJCylomeBG6jzkWOqIISv1lLTiwuqvnnU+Dx2GXQ60o4FYamrmil rSUOcLBOGStVo3IugXQFABNvMCRE9M7uxngpxYQGAxYLHrhBcYQzwqMuKinxcdjNvuNw 2tlFkG//U4PfUYc5Mnjdw/5/zcNcnRIDMR3BmX5QUxBM3WD/o+K1XaK47/9E3RbXf3q+ IRVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=C4nJ3mQim0DjOIKRXrRYC7uHpemFwr1VFesCkpoSuN8=; b=SGKhDPsg2ifi16QAVYfHeHrWmRimK5g7eSSSXuwyxiH/p/HKqbDlEN61a+gT64+7DM /n895hq6xSH5yCrXht1oSzziqGJA4pmh6BFEmW8wrl1mlMelmdeztm7sV6Uy0uISxPYw /ryh6j1BRPXPHse9Gkimhq0vJJBI//g0wbxu4fefP47JxJ4xRLfaNLinOaEy/Zt+1DUf es5+hK6vjkx4skR2FR8sIt6YRq8SO0/cYw4MrUSij9Qux/9V1gL4WKAPZtGuX7zRStji DI0CbRkjbTB48fu3sS+hWbdTZT/JAk1J2gA2z5l+zut8gwdnnKHRhRZz3lSfRGoavyiu 9VAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si523542ejc.542.2020.10.20.22.08.02; Tue, 20 Oct 2020 22:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407480AbgJTNc7 (ORCPT + 99 others); Tue, 20 Oct 2020 09:32:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407304AbgJTNc6 (ORCPT ); Tue, 20 Oct 2020 09:32:58 -0400 Received: from hillosipuli.retiisi.eu (hillosipuli.retiisi.eu [IPv6:2a01:4f9:c010:4572::81:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93562C061755; Tue, 20 Oct 2020 06:32:58 -0700 (PDT) Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.eu (Postfix) with ESMTPS id D8AC0634C89; Tue, 20 Oct 2020 16:32:54 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1kUrl2-0000Em-2S; Tue, 20 Oct 2020 16:32:56 +0300 Date: Tue, 20 Oct 2020 16:32:56 +0300 From: Sakari Ailus To: Sakari Ailus Cc: Daniel Scally , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux.walleij@linaro.org, prabhakar.mahadev-lad.rj@bp.renesas.com, heikki.krogerus@linux.intel.com, dmitry.torokhov@gmail.com, laurent.pinchart+renesas@ideasonboard.com, kieran.bingham+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, robh@kernel.org, davem@davemloft.net, linux@rasmusvillemoes.dk, andriy.shevchenko@linux.intel.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, pmladek@suse.com, mchehab@kernel.org, tian.shu.qiu@intel.com, bingbu.cao@intel.com, yong.zhi@intel.com, rafael@kernel.org, gregkh@linuxfoundation.org, kitakar@gmail.com, dan.carpenter@oracle.org Subject: Re: [RFC PATCH v3 4/9] software_node: Add support for fwnode_graph*() family of functions Message-ID: <20201020133254.GC843@valkosipuli.retiisi.org.uk> References: <20201019225903.14276-1-djrscally@gmail.com> <20201019225903.14276-5-djrscally@gmail.com> <20201020123556.GW13341@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201020123556.GW13341@paasikivi.fi.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > 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 > > Co-developed-by: Daniel Scally > > Signed-off-by: Daniel Scally > > --- > > 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