From: Vitor Soares <ivitro@gmail.com>
To: Ulf Hansson <ulfh@kernel.org>, Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>
Cc: Vitor Soares <vitor.soares@toradex.com>,
linux-pm@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Lucas Stach <l.stach@pengutronix.de>,
Advait Dhamorikar <advaitd@mechasystems.com>,
Marek Vasut <marex@nabladev.com>, Peng Fan <peng.fan@nxp.com>,
Adam Ford <aford173@gmail.com>
Subject: [PATCH v2 0/2] pmdomain: imx: fix suspend/resume order of the blk-ctrl virtual devices
Date: Thu, 26 Nov 2026 16:40:57 +0000 [thread overview]
Message-ID: <20261126164058.2373605-4-ivitro@gmail.com> (raw)
From: Vitor Soares <vitor.soares@toradex.com>
The i.MX8M blk-ctrl drivers drive the GPC domains through the virtual
devices from dev_pm_domain_attach_by_name(). These devices have no
parent and no device link, so their position in dpm_list relative to the
blk-ctrl consumers depends on probe order. When a consumer ends up
before them, the system hangs in the noirq phase.
Patch 1 fixes imx8m-blk-ctrl. It is v1 [2], now also linking the bus
domain virtual device:
- i.MX8MM, VPU: the codecs resume before the virtual devices and the CPU
hangs in genpd_resume_noirq() of 38310000.video-codec. On Verdin
iMX8MM this happens on the first suspend to mem.
- i.MX8MP, media: reported by Advait [1], the CPU hangs in
genpd_resume_noirq() of 32e40000.csi. His debug prints in
imx8m_blk_ctrl_power_on() show the stall at the first BLK_SFT_RSTN
read, after pm_runtime_get_sync() on the bus device returned 1.
- i.MX8MP, VPU: a normal boot works only because the Hantro codecs defer
their probe until the blk-ctrl is bound (the blk-ctrl waits for the
imx8mp interconnect module), and the deferred retry moves them to the
end of dpm_list. Loading hantro-vpu after the blk-ctrl has probed
reproduces the hang on resume.
Patch 2 does the same for imx8mp-blk-ctrl (HSIO and HDMI) and is new in
v2:
- i.MX8MP, HSIO: loading phy-fsl-imx8m-pcie after the blk-ctrl has
probed puts the PCIe PHY before the virtual devices. On suspend the
HSIO bus domain is powered off first, and genpd_suspend_noirq() of
32f00000.pcie-phy never returns. With the module loaded at boot, the
PHY defers, ends up after the virtual devices, and suspend works.
On Ulf's question in v1 [3]: the GPC domains cannot be genpd parents of
the blk-ctrl domains, because their power-up is interleaved with the
blk-ctrl reset and clocks (see 25e252bcf159), so the blk-ctrl drives
them with runtime PM on the virtual devices. The consumer drivers only
see the blk-ctrl domains. Runtime PM is disabled in the noirq phase, so
->suspend() keeps the virtual devices runtime active, and the runtime PM
calls of the blk-ctrl do not fail in the noirq phase, while the genpd
core powers the GPC domains off and on through the virtual devices. That
requires the virtual devices to be suspended after and resumed before
the consumers, which is what this series adds.
Lucas pointed to v1 as the correct fix in the original report [4].
Tested on top of ulfh/linux-pm fixes:
- Verdin iMX8MM: 20/20 suspend-to-mem cycles. Without the series, the
first suspend hangs and the watchdog resets the board.
- Verdin iMX8MP, hantro-vpu and phy-fsl-imx8m-pcie loaded after boot:
20/20 cycles. Without the series, the board hangs.
[1] https://lore.kernel.org/all/CAAPs2HTo=4+AEw1+vcU6c9vt_O2BfF+gv3FFvx9G3KLLzCOsHw@mail.gmail.com/
[2] https://lore.kernel.org/all/20240418155151.355133-1-ivitro@gmail.com/
[3] https://lore.kernel.org/all/CAPDyKFr9Vzgm2C6Z57Bg5mUQxg5LK6goN2og3+RC3BkTZjiqJw@mail.gmail.com/
[4] https://lore.kernel.org/all/8636fb8d9809aaafbd8274ec0dbfc250e1113c73.camel@pengutronix.de/
Vitor Soares (2):
pmdomain: imx8m-blk-ctrl: fix suspend/resume order
pmdomain: imx8mp-blk-ctrl: fix suspend/resume order
drivers/pmdomain/imx/imx8m-blk-ctrl.c | 29 ++++++++++++++++++++++++--
drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 29 ++++++++++++++++++++++++--
2 files changed, 54 insertions(+), 4 deletions(-)
base-commit: 458777762756acfc7d2c20067cca6cc817cc8dec
--
2.53.0
next reply other threads:[~2026-11-26 16:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 16:40 Vitor Soares [this message]
2026-11-26 16:40 ` [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: fix suspend/resume order Vitor Soares
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=20261126164058.2373605-4-ivitro@gmail.com \
--to=ivitro@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=advaitd@mechasystems.com \
--cc=aford173@gmail.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=marex@nabladev.com \
--cc=peng.fan@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=ulfh@kernel.org \
--cc=vitor.soares@toradex.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