Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhipeng.wang_1@oss.nxp.com
To: Thomas Gleixner <tglx@kernel.org>, Marc Zyngier <maz@kernel.org>,
	Frank Li <Frank.Li@nxp.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Jindong Yue <jindong.yue@nxp.com>,
	xuegang.liu@nxp.com, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 0/5] irqchip/imx-irqsteer: Allow building as module
Date: Wed, 19 Aug 2026 18:05:38 +0900	[thread overview]
Message-ID: <20260819090543.585131-1-Zhipeng.wang_1@oss.nxp.com> (raw)

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

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

v3 was a four-patch series: three fixes for pre-existing bugs that only
become reachable once the driver can be unbound/reloaded, followed by
the module conversion. On v3, Frank Li reviewed the unload-path fixes
and asked for three changes, all addressed here:

 - The probe() error-path irq_domain leak was fixed by hand-rolling an
   err_domain label. Frank suggested a devres-managed domain instead,
   and to add a reusable devm_irq_domain_create_linear() helper so other
   drivers benefit. Patch 1/5 adds that helper (the devres sibling of
   irq_domain_create_linear()); patch 2/5 switches imx-irqsteer to it,
   which fixes the leak structurally and lets remove() drop its explicit
   irq_domain_remove().

 - Frank questioned why remove() disposed of the mappings "twice". The
   two loops disposed of two different sets: the parent output mappings
   the driver created with irq_of_parse_and_map(), and the child input
   mappings the domain handed out. The child mappings are freed by their
   consumers and, with the domain now owned by devres, are torn down
   automatically; only the parent mappings need explicit disposal. Patch
   3/5 disposes of the parent mappings only, dropping the child loop.

 - Frank pointed out that masking in remove() touches CHANMASK while the
   device may be runtime-suspended with the clock gated. The remove()
   masking is unnecessary: the next probe() quiesces the hardware before
   it re-maps and unmasks the parent interrupts, which is the only window
   in which a stale line could storm. Patch 4/5 therefore masks only in
   probe().

Patch 5/5 then converts the driver to a module. As in v3, it lets devres
own the clock and runtime PM (devm_clk_get_enabled() +
devm_pm_runtime_set_active_enabled()).

Changes in v4:
 - New patch 1/5: add devm_irq_domain_create_linear() (Frank Li).
 - Patch 2/5 (was "Fix error handling path in probe()"): use the new
   devm helper to manage the domain instead of hand-rolling an
   err_domain label; remove() drops irq_domain_remove() (Frank Li).
 - Patch 3/5 (was 2/4): dispose of the parent mappings only; the child
   mapping disposal loop is removed (Frank Li).
 - Patch 4/5 (was 3/4): mask interrupts in probe() only; the remove()
   masking, which could touch registers while runtime-suspended, is
   dropped (Frank Li).
 - Patch 5/5 (was 4/4): no functional change; remove() and the probe()
   error path now only dispose of the parent mappings.

v3: https://lore.kernel.org/r/20260807072346.1222389-1-Zhipeng.wang_1@oss.nxp.com
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 (4):
  genirq/irqdomain: Add devm_irq_domain_create_linear()
  irqchip/imx-irqsteer: Use devm to manage the IRQ domain
  irqchip/imx-irqsteer: Dispose of parent IRQ mappings in remove()
  irqchip/imx-irqsteer: Mask all interrupts in probe()

 drivers/irqchip/Kconfig            |  2 +-
 drivers/irqchip/irq-imx-irqsteer.c | 52 +++++++++++++++++++-----------
 include/linux/irqdomain.h          | 30 +++++++++++++++++
 3 files changed, 64 insertions(+), 20 deletions(-)


base-commit: bd5f485f3f026225b86573e559af0b7254ef4184
-- 
2.34.1



             reply	other threads:[~2026-08-19  9:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19  9:05 Zhipeng.wang_1 [this message]
2026-08-19  9:05 ` [PATCH v4 1/5] genirq/irqdomain: Add devm_irq_domain_create_linear() Zhipeng.wang_1
2026-08-19 14:23   ` Frank Li
2026-08-19 16:27   ` Thomas Gleixner
2026-08-19  9:05 ` [PATCH v4 2/5] irqchip/imx-irqsteer: Use devm to manage the IRQ domain Zhipeng.wang_1
2026-08-19 14:24   ` Frank Li
2026-08-19 16:28     ` Thomas Gleixner
2026-08-19  9:05 ` [PATCH v4 3/5] irqchip/imx-irqsteer: Dispose of parent IRQ mappings in remove() Zhipeng.wang_1
2026-08-19 14:25   ` Frank Li
2026-08-19  9:05 ` [PATCH v4 4/5] irqchip/imx-irqsteer: Mask all interrupts in probe() Zhipeng.wang_1
2026-08-19  9:05 ` [PATCH v4 5/5] irqchip/imx-irqsteer: Allow building as module Zhipeng.wang_1
2026-08-19 15:17   ` Frank Li
2026-08-20  9:53     ` Zhipeng Wang (OSS)
2026-08-20 15:20       ` Frank Li
2026-08-20 16:53       ` Frank Li
2026-08-19 16:30   ` Thomas Gleixner
2026-08-19 16:20 ` [PATCH v4 0/5] " Thomas Gleixner

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=20260819090543.585131-1-Zhipeng.wang_1@oss.nxp.com \
    --to=zhipeng.wang_1@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=jindong.yue@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=tglx@kernel.org \
    --cc=xuegang.liu@nxp.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