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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34863C432C0 for ; Fri, 29 Nov 2019 21:11:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F18AC21771 for ; Fri, 29 Nov 2019 21:11:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X4zwdUJB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lB9otGP+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F18AC21771 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NwgTH29aEpHwzrTVzBqIjxLe9PjyJEE/uVfnOywQdiw=; b=X4zwdUJBOYtfMG QdoSr4dju1jDSF5ctNkQio7MULOT0UvwpmSQI3Bci5ZVPAchpVjWUtdCdEjRiQCYUt7lUVyt75RM/ JF3fwzGD0qrqcdivsQ4tWpF9kyPlZ1eJE74ZyUgU4RCWZE/T/KzLewQg5LbD+/O7nFYAKsI5C9VL0 iC4k0bFgx1je0A38YbEA2sfpBhdaJA7uzOO/22AsQ/77/9LgwAm1WcH7HxbOUGN9qjU9oX1Fwh6D3 q4oPMVVsfHxIYVnPQh4TrNcig48eZeqqJkTTsZhHd+S0ZnsPaHkcrhup10wmXaR4H/52Iqg2nEAGK 8jAfrnhlwyhqs131rNHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ianY1-0008DW-C6; Fri, 29 Nov 2019 21:11:29 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ianXy-00085c-5P for linux-arm-kernel@lists.infradead.org; Fri, 29 Nov 2019 21:11:27 +0000 Received: by mail-il1-x142.google.com with SMTP id t9so8340393iln.4 for ; Fri, 29 Nov 2019 13:11:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J737RfycvasrkDMuXXVhGv8GjJozMIk9WjH6tUo8YNU=; b=lB9otGP+R7D5FDCg+yCl5lzrEbHVc6Uxs0+r8izKBMVVOofA3vofUwCrTGfrnh/HzZ nQhDEkKv9iFoZWHxi6Lm1vM755MYXzxCy5RZp4jPRE/gJ2i9XvIJGWnd9ekCs/i9szP+ 517eLdsZZuxFUU4mWYjZgOVY1hD6uyvbW1lnCzq/wktHxgnQA6T1f0c9qQjJHQmI0zbI 8V+2XFBdclfe41bWEdDMCU2YuW4KMdfuROPYnbBrNDN52yqzzuCMy8RtBtAnZxGVEyDm ntE4PwYVP+sP+TljhMeQQ5sxV0Ry0ylzC2Nuyf3oC2BT/Tqn/gwKUaSZXUT6AHKd8tDK rpEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J737RfycvasrkDMuXXVhGv8GjJozMIk9WjH6tUo8YNU=; b=oO+h2qY5jpwh87xZKL5RF6LmmFlld7MZADTUeNrwp+x+0M1n0SI0ArgQ6NL4teb9uZ +DggLPzZHXFRbxIjlXlO8sdZFzUNnrfok2F2IHl3CGR1iEXSDtNYz0zNsVZKyrdWvWKN ijaQbFHI478b+NIlDYFNq+nlp4Plm+zYRG2iDcbyvO008+fMTCzPcKVxjY11JD4O3hk5 eLCngigMb9dsE+z56rjOWefN8rF5icrqClytAt5jTSiptToTgj4PrbLtDG6WUn+HUizd HdTAiA90VPyGfcK/URwvduK7CjiU4FjYVCDHMY/MAvlZ09t4ij1z/VE3gBKEajU7rQPv goyA== X-Gm-Message-State: APjAAAVwBadNqN8iPFOe1+w/N64UDblG200ztGlfeavdQ9VUV5zLnXGW mRbzelh53Dh+dEDqer/5wjx9iJCflcP6smdk1TGgLA== X-Google-Smtp-Source: APXvYqyOXHCVc3ozOJPEmGcC3VwB8m0Qnuuz5GE4mQlGcSQvgINwg2paqQAOa7PK0kmgMZbGH4Jw33/Thcthow443Ck= X-Received: by 2002:a92:1547:: with SMTP id v68mr13668342ilk.58.1575061884570; Fri, 29 Nov 2019 13:11:24 -0800 (PST) MIME-Version: 1.0 References: <20191119231912.12768-1-mike.leach@linaro.org> <20191119231912.12768-8-mike.leach@linaro.org> <20191125212258.GB18542@xps15> <35357ff3-2b1e-764e-cfbd-65bcc7a4faa6@arm.com> In-Reply-To: <35357ff3-2b1e-764e-cfbd-65bcc7a4faa6@arm.com> From: Mathieu Poirier Date: Fri, 29 Nov 2019 14:11:13 -0700 Message-ID: Subject: Re: [PATCH v5 07/14] coresight: cti: Add device tree support for custom CTI. To: Suzuki Kuruppassery Poulose X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191129_131126_234353_241A1D6D X-CRM114-Status: GOOD ( 18.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Coresight ML , "open list:DOCUMENTATION" , linux-arm-kernel , Mike Leach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 29 Nov 2019 at 07:16, Suzuki Kuruppassery Poulose wrote: > > On 25/11/2019 21:22, Mathieu Poirier wrote: > > On Tue, Nov 19, 2019 at 11:19:05PM +0000, Mike Leach wrote: > >> Adds support for CTIs whose connections are implementation defined at > >> hardware design time, and not constrained by v8 architecture. > >> > >> These CTIs have no standard connection setup, all the settings have to > >> be defined in the device tree files. The patch creates a set of connections > >> and trigger signals based on the information provided. > >> > >> Signed-off-by: Mike Leach > >> --- > >> .../coresight/coresight-cti-platform.c | 250 +++++++++++++++++- > >> .../hwtracing/coresight/coresight-cti-sysfs.c | 11 + > >> 2 files changed, 257 insertions(+), 4 deletions(-) > > >> +static int cti_plat_create_impdef_connections(struct device *dev, > >> + struct cti_drvdata *drvdata) > >> +{ > >> + int rc = 0; > >> + struct fwnode_handle *fwnode = dev_fwnode(dev); > >> + struct fwnode_handle *child = NULL; > >> + > >> + if (IS_ERR_OR_NULL(fwnode)) > >> + return -EINVAL; > >> + > >> + fwnode_for_each_child_node(fwnode, child) { > >> + if (cti_plat_node_name_eq(child, CTI_DT_CONNS)) > >> + rc = cti_plat_create_connection(dev, drvdata, child); > >> + if (rc != 0) > >> + break; > >> + } > >> + fwnode_handle_put(child); > > > > As far as I can tell we don't need to call fwnode_handle_put()? > > Actually we do, if we break the scan in between, at least for of_nodes. > I had to literally look it down all the way down to confirm this. > > So for CONFIG_OF it ends up in of_get_next_available_child(), which > drops the ref on "prev" and grabs the "next". So in case we break > the loop, we must drop the ref on the child. Well spotted. > Otherwise, the last > result would be NULL, which would have dropped the ref on the "last" > valid entry. And this is harmless with a NULL ptr. > > Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel