From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=80.86.107.70 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795901826; b=5KV6OR8pbmvV957mxguUSFg3qjNPhCJoOaj4iqtPshzOUSECdVfqb9ox064XHwnShkWx gItAj/K27HHE2l+d7DPm9eryyQ7xHNZPUXqRpi/EU6w/BdFa7CsC/ofTBJMh58IONgDGE usSHiCM+Q5kTQPArQK/PUXx+ZzG8wKsj3cV72qv54kGC4DRHbMAMBCiLRO+stZcozNxs6 ukmmZ39MmFSsByt+CGcFHcYH9Q3XRVm19f00eLMVxMFuVTrmOsV9g0gYOSK+nGfrCK4RM IpDKGSeDPpq8YG7lzBFapSggBvO56/R9A3tEuJCQPJoVXpN6pcODtKVD7zIFheHa6Pw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795901826; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Subject:From:To:Cc: Date:In-Reply-To:References:Content-Type:Content-Transfer-Encoding: User-Agent:MIME-Version; bh=2lKGTLU+pp7rIL/la0aEpW/x8LEjT5X1Fwc92DV7VYU=; b=h4NuvT9q2jWAw6CtVXD8W1rWK2FPoKxkwB9Uz9oSLcIDC6DQpKP2AsKel+rxQCoWs8KY 0XyJ+yW1nsnk1y1MkjlGev6oU5v6h9ZsTsGBbsiDyfDDBCxGcLio1gkyYDikDOL+xYXT9 0fmR9Y8ZTnR9nTo5R/WLDRdzyassJXIndoaihY9uc5jcqzpR93hU0dL6GYL+EfZHnNMOg yiCWaT79I9MCdXUjMjUvpYYJmezVSbEXjpv3lYHNZfNCG5fXpZoGwZp02j0a0pyW/7PGo XowEEb3PIrpTaAW0vqm209r14Xrwxjy5kgMDubP7BtrPYcQBcFwHqUwsq+yE3VnO8HA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=rendec.net; spf=pass smtp.mailfrom=rendec.net; dkim=pass header.d=rendec.net header.i=@rendec.net header.a=rsa-sha256 header.s=default header.b=tizmuvWc; arc=none smtp.remote-ip=80.86.107.70 Received: from mail.mindbit.ro (xs1.mindbit.ro [80.86.107.70]) (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 B5D35606A31C for ; Sat, 28 Nov 2026 21:37:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B5D35606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=rendec.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rendec.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) 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; 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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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).