From patchwork Wed Mar 1 18:52:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 13156337 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 434D1C7EE2D for ; Wed, 1 Mar 2023 18:54:12 +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:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=25s3uoYGHbCpzXyvW/DQJaL9WQvg1FYdM9M6RemHAqE=; b=sUW2cXR+oKKyrP VdaD8SgtIa8AvywX5a95/XNNT6GHwKc9BBYaU1i4KgB9ltRF2GChRJBbwUgATLwyIddMASIHUWZB0 goIqSH3KxHA2cnBN03yxuiUIFBLCs/C3hSJkJOjlwUCyUkv0fcE9zcNYCnTubXFhC9xzd2hkoDAxN eImqG6uOwmF+FexTT0KZoywv9S2IwLqWZriPgUrYFooAyryv+c7YiOUAahN/35xkn2kFh8QFoFGmv EXTOfAo7jttYm2+y04PS8Vik6j7CfS1aaljOT87LIMDKaFUO/4bccYEv4v3GXXHDQItnu72ce23n4 Oq195fjCeqGeQ1NhE/1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXRaW-00HCke-95; Wed, 01 Mar 2023 18:54:04 +0000 Received: from smtpout1.mo528.mail-out.ovh.net ([46.105.34.251]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXRZk-00HCJU-BX; Wed, 01 Mar 2023 18:53:17 +0000 Received: from pro2.mail.ovh.net (unknown [10.109.156.120]) by mo528.mail-out.ovh.net (Postfix) with ESMTPS id 694A92195F; Wed, 1 Mar 2023 18:52:58 +0000 (UTC) Received: from localhost.localdomain (88.161.25.233) by DAG1EX1.emp2.local (172.16.2.1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 1 Mar 2023 19:52:57 +0100 From: Jean-Jacques Hiblot To: , , Geert Uytterhoeven , Magnus Damm , Russell King , Michael Ellerman , Nicholas Piggin , Christophe Leroy , , Daniel Lezcano , Thomas Gleixner , Claudiu Beznea , Marc Zyngier , , Manivannan Sadhasivam , Palmer Dabbelt , Paul Walmsley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Frank Rowand , Bjorn Helgaas , Nishanth Menon , , , , , CC: , , , , , , , , , , , , Jean-Jacques Hiblot Subject: [PATCH 0/3] of: irq: Fixes refcount issues with of_irq_parse_one()/of_irq_parse_raw() Date: Wed, 1 Mar 2023 19:52:06 +0100 Message-ID: <20230301185209.274134-1-jjhiblot@traphandler.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [88.161.25.233] X-ClientProxiedBy: DAG3EX2.emp2.local (172.16.2.22) To DAG1EX1.emp2.local (172.16.2.1) X-Ovh-Tracer-Id: 11460535153186650492 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudelhedguddutdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgtghisehtkeertdertddtnecuhfhrohhmpeflvggrnhdqlfgrtghquhgvshcujfhisghlohhtuceojhhjhhhisghlohhtsehtrhgrphhhrghnughlvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeejuefhkeelgffhlefhtefhgeektdevvdfgkeeltdehgeeujeeutdehkeeuhffftdenucfkphepuddvjedrtddrtddruddpkeekrdduiedurddvhedrvdeffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehjjhhhihgslhhothesthhrrghphhgrnhgulhgvrhdrtghomheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepshgrrhgrvhgrnhgrkhesghhoohhglhgvrdgtohhmpdhnmhesthhirdgtohhmpdhsshgrnhhtohhshheskhgvrhhnvghlrdhorhhgpdhmrghthhhirghsrdhnhihmrghnsehinhhtvghlrdgtohhmpdhgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhrghdpthhhihgvrhhrhidrrhgvughinhhgsehgmhgrihhlrdgtohhmpdhjohhnrghthhgrnhhhsehnvhhiughirgdrtghomhdplhhinhhugidqrh gvnhgvshgrshdqshhotgesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugihpphgtqdguvghvsehlihhsthhsrdhoiihlrggsshdrohhrghdplhhinhhugidqfihirhgvlhgvshhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhlihhnuhigqdgrtghtihhonhhssehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhlihhnuhigqdhsuhhngihisehlihhsthhsrdhlihhnuhigrdguvghvpdguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugidqphgtihesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugidquhhssgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpsghhvghlghgrrghssehgohhoghhlvgdrtghomhdpfhhrohifrghnugdrlhhishhtsehgmhgrihhlrdgtohhmpdhrohgshhdoughtsehkvghrnhgvlhdrohhrghdpshgrmhhuvghlsehshhholhhlrghnugdrohhrghdptghlvghmvghnthdrlhgvghgvrhessghoohhtlhhinhdrtghomhdpghgvvghrthdorhgvnhgvshgrshesghhlihguvghrrdgsvgdpmhgrghhnuhhsrdgurghmmhesghhmrghilhdrtghomhdplhhinhhugiesrghrmhhlihhnuhigrdhorhh grdhukhdpmhhpvgesvghllhgvrhhmrghnrdhiugdrrghupdhnphhighhgihhnsehgmhgrihhlrdgtohhmpdgthhhrihhsthhophhhvgdrlhgvrhhohiestghsghhrohhuphdrvghupdiirghjvggtheesghhmrghilhdrtghomhdplhhinhhugidqthgvghhrrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdptghlrghuughiuhdrsggviihnvggrsehmihgtrhhotghhihhprdgtohhmpdhmrgiisehkvghrnhgvlhdrohhrghdprghfrggvrhgsvghrsehsuhhsvgdruggvpdhmrghniheskhgvrhhnvghlrdhorhhgpdhprghlmhgvrhesuggrsggsvghlthdrtghomhdpphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdifvghnshestghsihgvrdhorhhgpdhjvghrnhgvjhdrshhkrhgrsggvtgesghhmrghilhdrtghomhdpthhglhigsehlihhnuhhtrhhonhhigidruggvpdfovfetjfhoshhtpehmohehvdekpdhmohguvgepshhmthhpohhuth X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230301_105316_736538_BDDEF241 X-CRM114-Status: GOOD ( 11.87 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This series attempts to fix refcounting issues related to of_irq_parse_one() and of_irq_parse_raw(). The first issue is simply that most callers of of_irq_parse_one() and of_irq_parse_raw() don't call of_node_put() on the returned device node when they no longer need it. The second issue is a double get() happening in of_irq_parse_one() when parsing the "interrupts-extended" properties. WARNING: I tried to be careful when modifying the callers of of_irq_parse_one()/of_irq_parse_raw() but haven't test-build all the changes. Jean-Jacques Hiblot (3): of: irq: make callers of of_irq_parse_raw() release the device node of: irq: make callers of of_irq_parse_one() release the device node of: irq: release the node after looking up for "interrupts-extended" .../mach-shmobile/regulator-quirk-rcar-gen2.c | 1 + arch/powerpc/platforms/fsl_uli1575.c | 1 + arch/powerpc/sysdev/mpic_msi.c | 1 + drivers/bcma/main.c | 5 +++- drivers/clocksource/timer-clint.c | 1 + drivers/irqchip/irq-mchp-eic.c | 1 + drivers/irqchip/irq-owl-sirq.c | 1 + drivers/irqchip/irq-renesas-rzg2l.c | 1 + drivers/irqchip/irq-sifive-plic.c | 1 + drivers/irqchip/irq-sun6i-r.c | 2 ++ drivers/of/irq.c | 30 ++++++++++++++----- drivers/of/unittest.c | 7 +++++ drivers/pci/of.c | 6 +++- drivers/soc/ti/knav_qmss_queue.c | 3 ++ drivers/usb/host/xhci-tegra.c | 1 + 15 files changed, 53 insertions(+), 9 deletions(-)