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 CB098C83F10 for ; Sat, 12 Jul 2025 11:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=5naVjINQX4Xjj0ZFaYnKa5ZruP4xAPMmRrYWsqkMAAs=; b=V8G1QZXdEpnQSSi5vzd2gsnv4m ehSdzjTg3qx6A8W2geEPpqxDov7tr792i29vLtWeBjLkFlYhLgY4AISMTzD6ambsBXXvOFzgHyC0z gXqpoAaGLss/G/vQvWv25BN6icZ7yjJ4U1EcrBSbHPNqlusAK1jybbE0AhJk1eS99cHe6o462cFwn PycZVPJZbhGuSpAHAD+wLIz8UzdoCJWr7sg7yEphqHjp7DlAWf3jYWNnhIRKgN6djnx7Yyr4k44Bw KjT5Ner5Odl/iivt7tsNI5Iaytp66HfD55/bNfSa8/WHMwvprM0+PhPCbHeZruD7dLo0y9K0OJsN6 ZaBf8VKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uaY2l-0000000GZil-3aWH; Sat, 12 Jul 2025 11:05:23 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uaY0N-0000000GZZr-0fEJ for linux-arm-kernel@lists.infradead.org; Sat, 12 Jul 2025 11:02:56 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 081A94448F; Sat, 12 Jul 2025 11:02:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4064C4CEEF; Sat, 12 Jul 2025 11:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752318173; bh=jzMQOv6iAdvYpHha5k/NLNgXonjVTEht8vlZgL3t88s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CcOB1mT7v+VIyTjxEWq0QBlFYvrwN8MSsuWw87TGYM0lqVdcqqq/QEM6ZW0FO7vGU kWnc0DgrKvkKAGQ7orW/8hnyMVS4QsbEsrEVphRBnfL+wj9FGZEToxM33UQ6SWCx4k H/Kn+seJcwGE87CrR9LpzRc0XiHz5/hMKuS4GG8EaRvWFgLQquSTq/LqmzGUefvWDM JF4+OOGcirhW8Ekfe9cOFhUSOhlvmmlYA9SqJB/jjgIHae6l7/x4oIqg/oNFzHsCWJ eoDRkrdWB76z1uno8/rozEwqtDE1pH/Kldqdup2r4D0vxlk8NI8wFTwfxUowhYeSbq fstC3/DkN8Pcg== 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 1uaY0J-00F6gZ-Cg; Sat, 12 Jul 2025 12:02:51 +0100 Date: Sat, 12 Jul 2025 12:02:51 +0100 Message-ID: <864ivhacys.wl-maz@kernel.org> From: Marc Zyngier To: Christophe JAILLET Cc: Thomas Gleixner , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Lucas Stach , Aisheng Dong , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] irqchip/imx-irqsteer: Fix irq handling if an error occurs in imx_irqsteer_irq_handler() In-Reply-To: References: 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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: christophe.jaillet@wanadoo.fr, tglx@linutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, l.stach@pengutronix.de, aisheng.dong@nxp.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@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-20250712_040255_236233_DF6BA0AC X-CRM114-Status: GOOD ( 25.82 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 12 Jul 2025 10:58:35 +0100, Christophe JAILLET wrote: >=20 > Le 17/11/2024 =C3=A0 12:21, Christophe JAILLET a =C3=A9crit=C2=A0: > > chained_irq_enter(() should be paired with a corresponding > > chained_irq_exit(). > >=20 > > Here, if (hwirq < 0), a early return occurs and chained_irq_exit() is n= ot > > called. >=20 > After several month without any feedback, this is a polite ping. > Is this patch correct? An untested patch is unlikely to make a lot of forward progress, to be honest. >=20 > CJ >=20 >=20 > >=20 > > Add a new label and a goto for fix it. > >=20 > > Fixes: 28528fca4908 ("irqchip/imx-irqsteer: Add multi output interrupts= support") > > Signed-off-by: Christophe JAILLET > > --- > > Compile tested only. > >=20 > > Review with care, irq handling is sometimes tricky... > > --- > > drivers/irqchip/irq-imx-irqsteer.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > >=20 > > diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-i= mx-irqsteer.c > > index 75a0e980ff35..59abe5a8beb8 100644 > > --- a/drivers/irqchip/irq-imx-irqsteer.c > > +++ b/drivers/irqchip/irq-imx-irqsteer.c > > @@ -135,7 +135,7 @@ static void imx_irqsteer_irq_handler(struct irq_des= c *desc) > > if (hwirq < 0) { > > pr_warn("%s: unable to get hwirq base for irq %d\n", > > __func__, irq); > > - return; > > + goto out; > > } > > for (i =3D 0; i < 2; i++, hwirq +=3D 32) { > > @@ -153,6 +153,7 @@ static void imx_irqsteer_irq_handler(struct irq_des= c *desc) > > generic_handle_domain_irq(data->domain, pos + hwirq); > > } > > +out: > > chained_irq_exit(irq_desc_get_chip(desc), desc); > > } The real question is *how* do you end-up in this situation. To trigger this case, you need a mux interrupt that is handled by imx_irqsteer_irq_handler(), but for which you haven't got a translation from DT the first place. Do you see the chicken and egg problem? In summary, this driver is checking for conditions that can't possibly happen, and this check should simply be deleted instead of being blindly "fixed". M. --=20 Without deviation from the norm, progress is not possible.