From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933261AbeALJUA (ORCPT + 1 other); Fri, 12 Jan 2018 04:20:00 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:38484 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932791AbeALJTy (ORCPT ); Fri, 12 Jan 2018 04:19:54 -0500 X-Google-Smtp-Source: ACJfBouDGiJOaLBvM88sat2zhKBJvHqSwm4UTEMKzsmBFMIgV99BP4WdhMgIZeNGlR1p1qabozmWVg== Date: Fri, 12 Jan 2018 10:19:51 +0100 From: Johan Hovold To: Mikko Perttunen , Thierry Reding Cc: Johan Hovold , Jonathan Hunter , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, stable , Mikko Perttunen Subject: Re: [PATCH] soc/tegra: pmc: fix child-node lookup Message-ID: <20180112091951.GC11344@localhost> References: <20171115094458.31666-1-johan@kernel.org> <43890bb2-f902-2fc4-7480-a8cb71061048@kapsi.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43890bb2-f902-2fc4-7480-a8cb71061048@kapsi.fi> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Nov 16, 2017 at 01:40:24PM +0200, Mikko Perttunen wrote: > On 15.11.2017 11:44, Johan Hovold wrote: > > Fix child-node lookup during probe, which ended up searching the whole > > device tree depth-first starting at the parent rather than just matching > > on its children. > > > > To make things worse, the parent pmc node could end up being prematurely > > freed as of_find_node_by_name() drops a reference to its first argument. > > > > Fixes: 3568df3d31d6 ("soc: tegra: Add thermal reset (thermtrip) support to PMC") > > Cc: stable # 4.0 > > Cc: Mikko Perttunen > > Signed-off-by: Johan Hovold > > --- > > drivers/soc/tegra/pmc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c > > index 0453ff6839a7..7e9ef3431bea 100644 > > --- a/drivers/soc/tegra/pmc.c > > +++ b/drivers/soc/tegra/pmc.c > > @@ -1321,7 +1321,7 @@ static void tegra_pmc_init_tsense_reset(struct tegra_pmc *pmc) > > if (!pmc->soc->has_tsense_reset) > > return; > > > > - np = of_find_node_by_name(pmc->dev->of_node, "i2c-thermtrip"); > > + np = of_get_child_by_name(pmc->dev->of_node, "i2c-thermtrip"); > > if (!np) { > > dev_warn(dev, "i2c-thermtrip node not found, %s.\n", disabled); > > return; > > > > Good find! > > Reviewed-by: Mikko Perttunen This one still hasn't made it to linux-next so figured I'd send a reminder. Will you be picking this one up for 4.16, Thierry? Thanks, Johan