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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8E11DC25B74 for ; Thu, 30 May 2024 13:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+8VC8c4GrrmoXt7jFPDyyt5rv99rR1Jj4mmzSfVD/+s=; b=0GrRNKrdliK5NZ XRr7y3TQ5ktjAVKRVq1jdLAfOM9il5dobMBG3ejTdrD+ssqfzSzb2C6POYlfNoQovCOiRAhQh4v6g SotW0GsmcTma1l30fqV2+fLquJ22cymKuOW2+vBaM+THiBZZnmB5ao65CrFXUrNs9X4gB4vHPtLs1 eRA4icf7tpbpxxewf6sk01fbVvnaGET+/kZ33k3w+F0Z1oD4vbw8yH3EtPmewZX4n7QKlRv/bMci+ cSFYJJx92o7xycQ8TeSPdtKR9kBf3bsJAgOm80hnGvdTv9Qo//0bXvV78UGxnrON3rx+99gL2d8GL 46elULD5rxeeM5r6/DFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCg6n-00000007Pgt-0u3K; Thu, 30 May 2024 13:46:21 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCg6j-00000007PfV-0wfW; Thu, 30 May 2024 13:46:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8A385CE1A95; Thu, 30 May 2024 13:46:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA33CC32786; Thu, 30 May 2024 13:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717076773; bh=rmN/CuQwtYSCBMHu0PjHZJZkczGNhMDmrCHhNf4781Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=N6N7K8U1MYLtPsBvXFs4TMoPJIyyQYodKhzeKWKXvjBx6NnSqm1INEI5J2cr8vikJ VtxS0wca+ityVskAlyT+MKFjyA6a+eKjhLGTpvpFK6avUHBxTtppM/MtBIX9Kf2JW6 1cNHssEUfIxrmIu773b+YJgI8rx8eJPlxl3PfJ0GS0vytuc65B11gdqoHD5F0rfteU 2Pow+aOPjg9GKGIXfGdXH/Z2I5MoJPt19TYa0OpnaiRN+qrjNbLjCFa03IkHTMpkNL eoG5RDAmVlJ6hboF+ewwQXAt/Tcew5QW0uG5FhinzkhYw2gVlO48Jhg7GGaR90Lnhi AuqpdKi27HPng== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sCg6d-00GuJ9-DW; Thu, 30 May 2024 14:46:11 +0100 Date: Thu, 30 May 2024 14:46:10 +0100 Message-ID: <86y17rl8f1.wl-maz@kernel.org> From: Marc Zyngier To: "Rob Herring (Arm)" Cc: Saravana Kannan , Anup Patel , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v2 1/2] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw() In-Reply-To: <20240529-dt-interrupt-map-fix-v2-1-ef86dc5bcd2a@kernel.org> References: <20240529-dt-interrupt-map-fix-v2-0-ef86dc5bcd2a@kernel.org> <20240529-dt-interrupt-map-fix-v2-1-ef86dc5bcd2a@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: robh@kernel.org, saravanak@google.com, apatel@ventanamicro.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240530_064617_689409_113338E6 X-CRM114-Status: GOOD ( 23.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 29 May 2024 20:59:20 +0100, "Rob Herring (Arm)" wrote: > > Factor out the parsing of interrupt-map interrupt parent phandle and its > arg cells to a separate function, of_irq_parse_imap_parent(), so that it > can be used in other parsing scenarios (e.g. fw_devlink). > > There was a refcount leak on non-matching entries when iterating thru > "interrupt-map" which is fixed. > > Signed-off-by: Rob Herring (Arm) > --- > drivers/of/irq.c | 127 +++++++++++++++++++++++++++++------------------- > drivers/of/of_private.h | 3 ++ > 2 files changed, 79 insertions(+), 51 deletions(-) > > diff --git a/drivers/of/irq.c b/drivers/of/irq.c > index 174900072c18..a7cdb892991e 100644 > --- a/drivers/of/irq.c > +++ b/drivers/of/irq.c > @@ -25,6 +25,8 @@ > #include > #include > > +#include "of_private.h" > + > /** > * irq_of_parse_and_map - Parse and map an interrupt into linux virq space > * @dev: Device node of the device whose interrupt is to be mapped > @@ -96,6 +98,59 @@ static const char * const of_irq_imap_abusers[] = { > NULL, > }; > > +const __be32 *of_irq_parse_imap_parent(const __be32 *imap, int len, struct of_phandle_args *out_irq) > +{ > + u32 intsize, addrsize; > + struct device_node *np; > + > + /* Get the interrupt parent */ > + if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) > + np = of_node_get(of_irq_dflt_pic); > + else > + np = of_find_node_by_phandle(be32_to_cpup(imap)); > + imap++; > + > + /* Check if not found */ > + if (!np) { > + pr_debug(" -> imap parent not found !\n"); > + return NULL; > + } > + > + /* Get #interrupt-cells and #address-cells of new > + * parent > + */ nit: funky formatting. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel