Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 0/3] pmdomain: imx: build the SCU power domain driver as a module
@ 2026-07-22  8:25 Zhipeng.wang_1
  2026-07-22  8:25 ` [PATCH v4 1/3] of: export of_stdout symbol Zhipeng.wang_1
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zhipeng.wang_1 @ 2026-07-22  8:25 UTC (permalink / raw)
  To: robh, saravanak, ulfh, Frank.Li, s.hauer
  Cc: kernel, festevam, peng.fan, aisheng.dong, jindong.yue,
	xuegang.liu, devicetree, linux-pm, imx, linux-arm-kernel,
	linux-kernel, linux-clk

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

This series makes the i.MX SCU power domain driver buildable as a
loadable module, which is required for Android devices using the
Generic Kernel Image (GKI) where SoC-specific drivers must be modules.

Patch 1 exports of_stdout (which the driver references to find the
console's power domain) from the OF core with EXPORT_SYMBOL_GPL().

Patch 2 converts CONFIG_IMX_SCU_PD from bool to tristate and adds
MODULE_DEVICE_TABLE() for autoloading. subsys_initcall() is used so
that when built-in the provider probes before its consumers (e.g. the
SCU clock driver at device_initcall level). No module_exit() is
provided since the provider cannot be safely removed at runtime.

Patch 3 adds MODULE_SOFTDEP("pre: imx_scu_pd") to the i.MX8QXP clock
driver so that modprobe loads the power domain module first when both
are built as modules.

Because of the cross-subsystem dependency (patches touch drivers/of,
drivers/pmdomain, and drivers/clk), I would suggest taking the whole
series through one tree.

Changes in v4:
- Add patch 3: MODULE_SOFTDEP in clk-imx8qxp to guarantee module load
  order when both drivers are modules. (Sashiko bot)

Changes in v3:
- Use subsys_initcall() instead of module_init() to fix probe ordering
  between the power domain provider and the SCU clock consumer when
  both are built-in. (Sashiko bot)

Changes in v2:
- Drop module_platform_driver() which provides module_exit() and could
  lead to use-after-free on module unload. Use module_init() only, so
  the module cannot be unloaded. (Sashiko bot)

Zhipeng Wang (3):
  of: export of_stdout symbol
  pmdomain: imx: scu-pd: allow building as a module
  clk: imx: imx8qxp: add soft dependency on SCU power domain driver

 drivers/clk/imx/clk-imx8qxp.c | 1 +
 drivers/of/base.c             | 1 +
 drivers/pmdomain/imx/Kconfig  | 2 +-
 drivers/pmdomain/imx/scu-pd.c | 8 +++++++-
 4 files changed, 10 insertions(+), 2 deletions(-)

-- 
2.34.1

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

end of thread, other threads:[~2026-07-22  8:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22  8:25 [PATCH v4 0/3] pmdomain: imx: build the SCU power domain driver as a module Zhipeng.wang_1
2026-07-22  8:25 ` [PATCH v4 1/3] of: export of_stdout symbol Zhipeng.wang_1
2026-07-22  8:25 ` [PATCH v4 2/3] pmdomain: imx: scu-pd: allow building as a module Zhipeng.wang_1
2026-07-22  8:38   ` sashiko-bot
2026-07-22  8:25 ` [PATCH v4 3/3] clk: imx: imx8qxp: add soft dependency on SCU power domain driver Zhipeng.wang_1
2026-07-22  8:35   ` sashiko-bot

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