From: Radu Rendec <radu@rendec.net>
To: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>,
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
Subject: Re: [PATCH 0/3] irqchip: Remove interrupt domains on driver teardown
Date: Sat, 28 Nov 2026 16:36:52 -0500 [thread overview]
Message-ID: <c3d6cdb5b17436413ee894bb109dca5b776c7684.camel@rendec.net> (raw)
In-Reply-To: <20261128-f81b700d6c-u38-0@mail.sdu.edu.cn>
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.
>
> Guangshuo Li (3):
> irqchip/ls-extirq: Remove the interrupt domain on unbind
> irqchip/ti-sci-intr: Remove the interrupt domain on unbind
> irqchip/uniphier-aidet: Remove the interrupt domain on unbind
>
> 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).
prev parent reply other threads:[~2026-11-28 21:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 9:41 Guangshuo Li
2026-11-28 9:41 ` [PATCH 1/3] irqchip/ls-extirq: Remove the interrupt domain on unbind Guangshuo Li
2026-11-28 9:41 ` [PATCH 2/3] irqchip/ti-sci-intr: " Guangshuo Li
2026-11-28 9:41 ` [PATCH 3/3] irqchip/uniphier-aidet: " Guangshuo Li
2026-11-28 21:36 ` Radu Rendec [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c3d6cdb5b17436413ee894bb109dca5b776c7684.camel@rendec.net \
--to=radu@rendec.net \
--cc=alexander.stein@ew.tq-group.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=ioana.ciornei@nxp.com \
--cc=kristo@kernel.org \
--cc=liguangshuo@mail.sdu.edu.cn \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lokeshvutla@ti.com \
--cc=maz@kernel.org \
--cc=mhiramat@kernel.org \
--cc=nm@ti.com \
--cc=robh@kernel.org \
--cc=ssantosh@kernel.org \
--cc=tglx@kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®