Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] irqchip/imx-irqsteer: Allow building as module
@ 2026-08-07  7:23 Zhipeng.wang_1
  2026-08-07  7:23 ` [PATCH v3 1/4] irqchip/imx-irqsteer: Fix error handling path in probe() Zhipeng.wang_1
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Zhipeng.wang_1 @ 2026-08-07  7:23 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier, Frank Li
  Cc: Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Jindong Yue,
	xuegang.liu, linux-kernel, imx, linux-arm-kernel

From: Zhipeng Wang <zhipeng.wang_1@nxp.com>

This series makes the i.MX IRQSTEER driver buildable as a module.

v2 was a single patch that folded the module conversion together with
the unload-path fixes. Following review, v3 splits it into four logical
changes: three fixes for pre-existing bugs that only become reachable
once the driver can be unbound/reloaded, followed by the module
conversion itself.

The three fixes address the module-related issues raised on v2:

 - Sashiko AI reported an irq_domain leak on the probe() error path that
   turns into a use-after-free once the module can be unloaded. Patch
   1/4 fixes the error path.
 - The IRQ mappings created in probe() were leaked on unload, and the
   child irq_descs kept pointing at the driver's irq_chip past
   irq_domain_remove(). Patch 2/4 disposes of them in remove().
 - Sashiko AI reported an interrupt storm on module reload because the
   CHANMASK registers retain their previous state. Patch 3/4 masks all
   interrupts in probe() and remove().

Patch 4/4 then converts the driver to a module. Per Frank Li's review,
it lets devres own the clock and runtime PM
(devm_clk_get_enabled() + devm_pm_runtime_set_active_enabled()) instead
of hand-balancing them in remove(), which also drops the manual
pm_runtime_get_sync()/clk_disable_unprepare() dance from the v2 remove().

The two remaining pre-existing handler issues Sashiko AI flagged (the
missing chained_irq_exit() on the handler error path, and register
access while runtime-suspended) are unrelated to module enablement and
are out of scope for this series; the chained_irq_exit() fix is sent
separately.

Changes in v3:
 - Split the single v2 patch into four patches.
 - Add the probe() error-path fix as patch 1/4 (Sashiko AI).
 - Add CHANMASK masking in probe()/remove() as patch 3/4 (Sashiko AI).
 - In the module conversion, let devres own the clock and runtime PM via
   devm_clk_get_enabled() and devm_pm_runtime_set_active_enabled(),
   dropping the manual runtime-PM/clock balancing from the v2 remove()
   (Frank Li).

v2: https://lore.kernel.org/r/20260728092219.525449-1-Zhipeng.wang_1@oss.nxp.com
v1: https://lore.kernel.org/r/20260724090136.3595894-1-Zhipeng.wang_1@oss.nxp.com

Jindong Yue (1):
  irqchip/imx-irqsteer: Allow building as module

Zhipeng Wang (3):
  irqchip/imx-irqsteer: Fix error handling path in probe()
  irqchip/imx-irqsteer: Dispose of IRQ mappings in remove()
  irqchip/imx-irqsteer: Mask all interrupts in probe() and remove()

 drivers/irqchip/Kconfig            |  2 +-
 drivers/irqchip/irq-imx-irqsteer.c | 60 ++++++++++++++++++++----------
 2 files changed, 41 insertions(+), 21 deletions(-)


base-commit: c0a27675eaf08255017b3cabc28c99c0cd71f468
-- 
2.34.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-08-07 19:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  7:23 [PATCH v3 0/4] irqchip/imx-irqsteer: Allow building as module Zhipeng.wang_1
2026-08-07  7:23 ` [PATCH v3 1/4] irqchip/imx-irqsteer: Fix error handling path in probe() Zhipeng.wang_1
2026-08-07 19:01   ` Frank Li
2026-08-07  7:23 ` [PATCH v3 2/4] irqchip/imx-irqsteer: Dispose of IRQ mappings in remove() Zhipeng.wang_1
2026-08-07 19:11   ` Frank Li
2026-08-07  7:23 ` [PATCH v3 3/4] irqchip/imx-irqsteer: Mask all interrupts in probe() and remove() Zhipeng.wang_1
2026-08-07 19:14   ` Frank Li
2026-08-07  7:23 ` [PATCH v3 4/4] irqchip/imx-irqsteer: Allow building as module Zhipeng.wang_1

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox