RE: [PATCH v6 7/9] irqchip/imx-irqsteer: Allow building as module
From: Zhipeng Wang (OSS)
Date: Wed Oct 21 2026 - 04:12:06 EST
> Subject: Re: [PATCH v6 7/9] irqchip/imx-irqsteer: Allow building as module
>
> On Thu, 2026-10-08 at 18:02 +0900, Zhipeng.wang_1@xxxxxxxxxxx wrote:
> > From: Jindong Yue <jindong.yue@xxxxxxx>
> >
> > Make the driver buildable as a module by turning the Kconfig symbol
> > into a tristate and using module_platform_driver() instead of
> > builtin_platform_driver(), and add the MODULE_DEVICE_TABLE() and
> > module metadata needed for autoloading.
>
> I believe both high-severity issues flagged by sashiko [1] are valid.
> Looking at what other drivers do (e.g. drivers/irqchip/irq-ts4800.c,
> drivers/irqchip/irq-pruss-intc.c), you should do something similar:
> iterate over the hwirqs and call irq_dispose_mapping(). That would solve both
> problems because synchronize_irq() gets called indirectly via
> irq_domain_disassociate().
>
> There is nothing wrong with the patch itself (the conversion to loadable
> module), so my r-b tag can stay as long as the above issue is addressed in a
> separate patch. Thanks!
>
> [1] https://lore.kernel.org/all/sashiko-outbox-163920@xxxxxxxxxx/
>
Hi Radu,
Agreed, both issues are valid. I'll add a separate patch that iterates
over the domain's hwirqs and calls irq_dispose_mapping() in remove(), as
in irq-ts4800.c / irq-pruss-intc.c. As you noted, that calls
synchronize_irq() via irq_domain_disassociate(), which closes both the
teardown race and the dangling-chip-pointer problem.
Thanks for the pointers!
Zhipeng
> > The clock, runtime PM and IRQ domain are already owned by devres, so
> > no further teardown is needed to support unbind and reload.
> >
> > Signed-off-by: Jindong Yue <jindong.yue@xxxxxxx>
> > Signed-off-by: Zhipeng Wang <zhipeng.wang_1@xxxxxxx>
> > Reviewed-by: Radu Rendec <radu@xxxxxxxxxx>
> > ---
> > drivers/irqchip/Kconfig | 2 +-
> > drivers/irqchip/irq-imx-irqsteer.c | 7 ++++++-
> > 2 files changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index
> > 20b77fbc51ee..105108d2e6ff 100644
> > --- a/drivers/irqchip/Kconfig
> > +++ b/drivers/irqchip/Kconfig
> > @@ -555,7 +555,7 @@ config CSKY_APB_INTC
> > the controller's register.
> >
> > config IMX_IRQSTEER
> > - bool "i.MX IRQSTEER support"
> > + tristate "i.MX IRQSTEER support"
> > depends on ARCH_MXC || ARCH_S32 || COMPILE_TEST
> > default y if ARCH_MXC || ARCH_S32
> > select IRQ_DOMAIN
> > diff --git a/drivers/irqchip/irq-imx-irqsteer.c
> > b/drivers/irqchip/irq-imx-irqsteer.c
> > index 15ee50f65d54..85edd5e33ca9 100644
> > --- a/drivers/irqchip/irq-imx-irqsteer.c
> > +++ b/drivers/irqchip/irq-imx-irqsteer.c
> > @@ -10,6 +10,7 @@
> > #include <linux/irqchip/chained_irq.h>
> > #include <linux/irqdomain.h>
> > #include <linux/kernel.h>
> > +#include <linux/module.h>
> > #include <linux/of.h>
> > #include <linux/of_irq.h>
> > #include <linux/platform_device.h>
> > @@ -359,6 +360,7 @@ static const struct of_device_id imx_irqsteer_dt_ids[]
> = {
> > { .compatible = "nxp,s32n79-irqsteer", .data = &s32n79_data },
> > {},
> > };
> > +MODULE_DEVICE_TABLE(of, imx_irqsteer_dt_ids);
> >
> > static struct platform_driver imx_irqsteer_driver = {
> > .driver = {
> > @@ -369,4 +371,7 @@ static struct platform_driver imx_irqsteer_driver = {
> > .probe = imx_irqsteer_probe,
> > .remove = imx_irqsteer_remove,
> > };
> > -builtin_platform_driver(imx_irqsteer_driver);
> > +module_platform_driver(imx_irqsteer_driver);
> > +
> > +MODULE_DESCRIPTION("i.MX IRQSTEER interrupt multiplexer/remapper
> > +driver"); MODULE_LICENSE("GPL");