Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4061442rwj; Tue, 20 Dec 2022 05:43:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXuTlm6O/G6/viy2mVvCgYtkuIrEio7yf/tr10LeQmWuQhVdOitincbd9fGYaNXuo2hh91Ou X-Received: by 2002:a17:907:c089:b0:838:1b80:9a7a with SMTP id st9-20020a170907c08900b008381b809a7amr1490250ejc.12.1671543834696; Tue, 20 Dec 2022 05:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671543834; cv=none; d=google.com; s=arc-20160816; b=DM20cnvBNG2r6n9PQE6cakbyoYOT3Ns5sYzxnzGoAN5FIfXaP7bg5wHMK55Uwb2oPa hGmPBK1chIlvnaU9CvJ7g/sXxpBmPF5bSFjhucqFOA+ExxQ6mDUCfIUeuCRJH7gZtI4L 46qhTiIywJz5Q1zCg+ClcmOlOloSxFQJVZNnngGElhJLASxrKku1t4yBtQVLFvKWDyx8 KAapuimKBHswt7dqRHkX82iSLUJqzR7GmKFR0I5ruo/Ooy+EQwCDmx8v5VGD5+iAVWCK paCWPfDESDFa5QXtPKQd2YJDe58RtaDaX1oIWhes18ORFRRv8CZoZttw1WruiXS6mf6U bm+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=yNhRyCGWrYX/cG/MAYG6MyG36zQ4Tn5AQHpgw1+kFXI=; b=e/xH73lOJLTArcknJHlVG/Ldt+y8p+teUrsHePp3Y5L2eRdIJu+IXxhYhOrEb1AX6R RTDtCM3+Irojv+LOuqAtN4ql7S+iJQ3olZZuLhzJW58WS1zNj8PxZj8azbN5zCCvfSd/ KWyFI4KSEHwtiLAuHFDocM/Z5bctITqFutqjJusX5nHmauexuDzB8kwoZlFU0mwT7AwD fQhKEYZOcuxU+QvIPKcJVJ/SeI2kRy4BS4plFk8K6KEgMOQSoYC9upuJKmCrdMLhSFsR xF9DKBsaD3+q+wrV7g5uNLdXgld05aV8nTL6LsxoNZ2cFsSJAzRMzgIZoEuHW7LJKaJQ xgHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a1709064b4500b007c01c6cf01dsi94740ejv.800.2022.12.20.05.43.38; Tue, 20 Dec 2022 05:43:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233726AbiLTN0J (ORCPT + 70 others); Tue, 20 Dec 2022 08:26:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233682AbiLTNZm (ORCPT ); Tue, 20 Dec 2022 08:25:42 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 110501A07D for ; Tue, 20 Dec 2022 05:25:17 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C41342F4; Tue, 20 Dec 2022 05:25:57 -0800 (PST) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2DD583F703; Tue, 20 Dec 2022 05:25:16 -0800 (PST) Date: Tue, 20 Dec 2022 13:25:13 +0000 From: Andre Przywara To: Martin Kaiser Cc: Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ARM: highbank: fix of node handling in highbank_init_irq Message-ID: <20221220132513.38d956e0@donnerap.cambridge.arm.com> In-Reply-To: <20221218142647.394881-3-martin@kaiser.cx> References: <20221218142647.394881-1-martin@kaiser.cx> <20221218142647.394881-3-martin@kaiser.cx> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 18 Dec 2022 15:26:47 +0100 Martin Kaiser wrote: Hi Martin, thanks for taking care of this. > highbank_init calls of_find_compatible_node and discards the returned > node. We should save the node and call of_node_put on it when finished. > > Signed-off-by: Martin Kaiser > --- > arch/arm/mach-highbank/highbank.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c > index 97ccb8c1b3cd..54eb1422ef8f 100644 > --- a/arch/arm/mach-highbank/highbank.c > +++ b/arch/arm/mach-highbank/highbank.c > @@ -50,10 +50,16 @@ static void highbank_l2c310_write_sec(unsigned long val, unsigned reg) > > static void __init highbank_init_irq(void) > { > + struct device_node *np; > + > irqchip_init(); > > - if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) > - highbank_scu_map_io(); > + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9"); > + if (!np) > + return; > + > + highbank_scu_map_io(); > + of_node_put(np); Technically the of_node_put() could happen even earlier, since we use the of_find_compatible_node() call only to figure out if this is the Cotex-A15 or the A9 part. But it doesn't really matter, and is correct anyways: Reviewed-by: Andre Przywara I also quickly boot tested this on a Midway(A15), but don't have a Highbank(A9) readily set up at the moment. Cheers, Andre > } > > static void highbank_power_off(void)