From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEFB8606A31C for ; Sat, 28 Nov 2026 21:37:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Pc31XYIA; dkim=pass (2048-bit key) header.d=rendec.net header.i=@rendec.net header.a=rsa-sha256 header.s=default header.b=tizmuvWc 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:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Date:Cc:To:From :Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=2lKGTLU+pp7rIL/la0aEpW/x8LEjT5X1Fwc92DV7VYU=; b=Pc31XYIAD+SVpp04xYlTjV44PI 49IrZU1csJIElN+jPyoVLehjewfRjxpdnrt/VBITkGXgDLRlAzT8Rkh2+vR2sP3OUcHIW7SJNBiZ2 7BoGU55rZMFX4tcxlh10ux+I0BuFOq80UJBHlHdkGX5XkGQqeXAJ5nXb+kxxriFemuaYCR626pj4T Fl3qkuncNt70Wf0NnYkniO/WgNQncfBSydMGwMf33eSmPEnnodKW+anSb2FqPc0prfbdopVpNEMyE MCFd3z6tCtTu/zUGFtQKy6i8zP1WdOfsodIjVn+iPhZ/DJ91i6pHckpn7HbTNZ7ZXzfEPz7LpGe/C WBLdchtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXQ6S-00000001DHS-3ZzP; Sat, 28 Nov 2026 21:37:04 +0000 Received: from xs1.mindbit.ro ([80.86.107.70] helo=mail.mindbit.ro) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXQ6Q-00000001DGc-0lj0 for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2026 21:37:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rendec.net; s=default; t=1795901816; bh=0xEXz/mJwH0tV5UoztstlNp8ug2uZPdFpj0hg57reQk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=tizmuvWcVvMoCjV212LtzyKLD2IwqBaTBnFBLKNCONrPXRW/cmYThq+fUFKiPoMCj 9iyZQr+LKIeX82jxaA318aNkMucJ2gd44FAInjMNiVm/FrwT01574g3zyHu81+IU6f FJRgxnA/1ZnSF+hEpcydiGK8YlWV09Kui9dGAmkRCTHTdFttKVD5lIovqQjAiOD3mP QZCjrWwDaT9I3yzGMTQSbz4pQxkytgwdN2z7iSYDbQ3pEC+UDJoPyBgpvrKwH9JC99 1cNwwXR1h3lWxjo7NCGos6QzlFbEZee7G6WV3k3CNP5aHUpqayPZV16mso4kTSq015 NgL1oVutQ8o+Q== Received: from [172.16.1.1] (pool-174-112-193-187.cpe.net.cable.rogers.com [174.112.193.187]) by mail.mindbit.ro (Postfix) with ESMTPSA id 02BE31C005E; Sat, 28 Nov 2026 23:36:53 +0200 (EET) Message-ID: Subject: Re: [PATCH 0/3] irqchip: Remove interrupt domains on driver teardown From: Radu Rendec To: Guangshuo Li , tglx@kernel.org, nm@ti.com, kristo@kernel.org, ssantosh@kernel.org, hayashi.kunihiko@socionext.com, mhiramat@kernel.org, ioana.ciornei@nxp.com, alexander.stein@ew.tq-group.com, maz@kernel.org, lokeshvutla@ti.com, yamada.masahiro@socionext.com, robh@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Sat, 28 Nov 2026 16:36:52 -0500 In-Reply-To: <20261128-f81b700d6c-u38-0@mail.sdu.edu.cn> References: <20261128-f81b700d6c-u38-0@mail.sdu.edu.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-0+deb13u1 X-Archived-By: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261128_133702_547189_A6E3519E X-CRM114-Status: GOOD ( 15.28 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sat, 2026-11-28 at 17:41 +0800, Guangshuo Li wrote: > Pair domain creation with removal in the LS external interrupt, TI SCI > interrupt and UniPhier AIDET drivers. >=20 > Guangshuo Li (3): > =C2=A0 irqchip/ls-extirq: Remove the interrupt domain on unbind > =C2=A0 irqchip/ti-sci-intr: Remove the interrupt domain on unbind > =C2=A0 irqchip/uniphier-aidet: Remove the interrupt domain on unbind >=20 > base-commit: 1aed0e209f0c3bb1f28d4d69c2fc23528d30981e Thanks for the patches! I agree that they fix a real bug: leaking the IRQ domain on the removal path - and it's true even for the drivers that can be compiled only as built-in because (at least in theory) the platform device can be explicitly unbound from the driver, even if the driver itself cannot be removed from the kernel. But I think the fix is incomplete and makes things worse in the presence of downstream IRQ consumers. irq_domain_remove() makes *no* checks for active mappings, and this is documented in the comment block above the function. So it will remove the per-domain data associated with mapped IRQs as well as the domain itself, while those IRQs are active and can trigger at any time. For irq-ls-extirq.c and irq-uniphier-aidet.c, I think the more reasonable fix is to disable unbinding by setting .suppress_bind_attrs to true in the driver structure. devm handling still makes sense for the reset of the probe function, for rollback on the failure paths; but the domain is created last and there's nothing else that can fail after that, so there's no need to ever remove it at probe time. For irq-ti-sci-intr.c, things are different because it's defined as tristate in Kconfig, so it can be unloaded. I would do something similar to what drivers/irqchip/irq-ts4800.c does in its remove function: iterate through the mappings and explicitly remove them, before calling irq_domain_remove(). That said, I think there are at least two other drivers that have similar/related problems: * drivers/irqchip/irq-ast2700-intc0.c has the same problem as this series tries to fix: it calls irq_domain_create_hierarchy() but there is no matching irq_domain_remove() for the unbind path. * drivers/irqchip/irq-stm32mp-exti.c does exactly what you did, and therefore has the problem I described above (for active mappings).