The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/8] irqchip/imx-intmux: Fix and modernize resource management
@ 2026-12-03  9:29 Peng Fan
  2026-12-03  9:29 ` [PATCH v2 1/8] irqchip/imx-intmux: Don't create parent mappings while counting channels Peng Fan
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Peng Fan @ 2026-12-03  9:29 UTC (permalink / raw)
  To: Thomas Gleixner, Radu Rendec, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shengjiu Wang,
	Marc Zyngier
  Cc: linux-kernel, imx, linux-arm-kernel, Peng Fan

When I worked on guard_chained_irq patch, sashiko reported pre-exist
issues in imx-intmux driver. So I gave a look on this driver and found
more that need to be addressed.

Even there are a few fixes, but I think they are not critial for current
release cycle.

The first patch avoids creating parent IRQ mappings while counting channels.
It counts the entries with of_irq_count() and resolves each parent lazily
with of_irq_get() in the channel loop, preserving -EPROBE_DEFER.

The next two patches fix the removal and probe error paths. Both mask the
parent interrupt, wait for an in-flight chained handler, detach it, dispose
the child mappings, and release the parent mapping. The probe error path
also unwinds the initialized channels, tears down runtime PM, and enables
the clock before touching runtime PM so that a clock failure cannot leave
the usage counter unbalanced; a pm_runtime_set_active() failure is
propagated after unwinding.

The next three patches tighten the device-tree input handling: reject a zero
channel count, return -EINVAL instead of WARNing on malformed interrupt
specifiers (including source numbers beyond the 32 inputs), and mark the
multiplexed interrupts as level-triggered to match handle_level_irq() and
the type advertised by xlate().

The last two patches are cleanups with no functional change: use
devm_irq_domain_create_linear() for the per-channel domains and factor the
per-channel teardown into a helper shared by the probe error and remove
paths.

The teardown assumes the default fw_devlink=on/rpm behaviour, where managed
device links unbind consumers before the interrupt controller so that
consumers release their IRQ actions first. With fw_devlink=off or
permissive, an active consumer can keep its IRQ actions and threads while
child mappings are disposed, and a concurrently probing consumer can race
with the deferred domain removal; those configurations are not supported by
this series.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v2:
- Add a patch to avoid creating parent IRQ mappings while counting channels,
  using of_irq_count() and lazy of_irq_get().
- Rework the zero channel count check for of_irq_count().
- Drain in-flight chained handlers before detaching them in the remove and
  probe error paths.
- Check pm_runtime_set_active() and enable the clock before runtime PM.
- Reject malformed interrupt specifiers in xlate instead of WARNing.
- Correct the devm IRQ domain lifetime description in the commit message.
- Document that the teardown relies on fw_devlink=on/rpm consumer ordering.
- Link to v1: https://lore.kernel.org/r/20261117-imx-intmux-v1-0-189e7e0ad98d@nxp.com

---
Peng Fan (8):
      irqchip/imx-intmux: Don't create parent mappings while counting channels
      irqchip/imx-intmux: Dispose IRQ mappings on remove
      irqchip/imx-intmux: Fix probe error path
      irqchip/imx-intmux: Reject zero channel count
      irqchip/imx-intmux: Mark input interrupts as level-triggered
      irqchip/imx-intmux: Don't WARN on malformed interrupt specifiers
      irqchip/imx-intmux: Use devm_irq_domain_create_linear()
      irqchip/imx-intmux: Factor out imx_intmux_teardown_channel()

 drivers/irqchip/irq-imx-intmux.c | 70 ++++++++++++++++++++++++++++------------
 1 file changed, 49 insertions(+), 21 deletions(-)
---
base-commit: 799dd936553182df5770dde7f38d94c8337df75a
change-id: 20261116-imx-intmux-7bebdcb8c20b

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>


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

end of thread, other threads:[~2026-12-03 14:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  9:29 [PATCH v2 0/8] irqchip/imx-intmux: Fix and modernize resource management Peng Fan
2026-12-03  9:29 ` [PATCH v2 1/8] irqchip/imx-intmux: Don't create parent mappings while counting channels Peng Fan
2026-12-03  9:29 ` [PATCH v2 2/8] irqchip/imx-intmux: Dispose IRQ mappings on remove Peng Fan
2026-12-03  9:29 ` [PATCH v2 3/8] irqchip/imx-intmux: Fix probe error path Peng Fan
2026-12-03  9:29 ` [PATCH v2 4/8] irqchip/imx-intmux: Reject zero channel count Peng Fan
2026-12-03  9:29 ` [PATCH v2 5/8] irqchip/imx-intmux: Mark input interrupts as level-triggered Peng Fan
2026-12-03  9:29 ` [PATCH v2 6/8] irqchip/imx-intmux: Don't WARN on malformed interrupt specifiers Peng Fan
2026-12-03  9:29 ` [PATCH v2 7/8] irqchip/imx-intmux: Use devm_irq_domain_create_linear() Peng Fan
2026-12-03  9:29 ` [PATCH v2 8/8] irqchip/imx-intmux: Factor out imx_intmux_teardown_channel() Peng Fan
2026-12-03 14:14 ` [PATCH v2 0/8] irqchip/imx-intmux: Fix and modernize resource management Peng Fan

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