Re: [PATCH v2 1/2] pmdomain: imx8m-blk-ctrl: fix suspend/resume order
From: Peng Fan (OSS)
Date: Mon Nov 30 2026 - 01:06:49 EST
On Thu, 26 Nov 2026 16:40:58 +0000 Vitor Soares <ivitro@xxxxxxxxx> wrote:
> From: Vitor Soares <vitor.soares@xxxxxxxxxxx>
>
> The GPC domains behind a blk-ctrl are driven with runtime PM on the
> virtual devices from dev_pm_domain_attach_by_name(). Runtime PM is
> disabled in the noirq phase, this is why the ->suspend callback exists:
> it keeps the virtual devices runtime active, so the runtime PM calls in
> imx8m_blk_ctrl_power_on() and imx8m_blk_ctrl_power_off() do not fail in
> the noirq phase, while the genpd core powers the GPC domains off and on
> through the virtual devices. This requires the virtual devices to resume
> before the consumers of the blk-ctrl domains: genpd_resume_noirq() of a
> consumer calls imx8m_blk_ctrl_power_on(), which accesses the blk-ctrl
> registers expecting the bus domain to be on.
>
> Nothing orders the virtual devices in dpm_list: they have no parent and
> no device link to the blk-ctrl or its consumers. On i.MX8MM the VPU
> codecs resume before the virtual devices and the CPU hangs in
> genpd_resume_noirq() of 38310000.video-codec. The system never resumes
> from suspend to mem; with a watchdog running, the board is eventually
> reset. The same happens on i.MX8MP with the media blk-ctrl, where the
> CPU hangs in genpd_resume_noirq() of the MIPI CSI-2 receiver, and with
> the VPU blk-ctrl when the hantro-vpu module is loaded after the blk-ctrl
> has probed.
>
> Add a stateless device link from the blk-ctrl to each virtual device,
> bus domain included, so they are suspended after and resumed before the
> blk-ctrl and its consumers.
>
> Fixes: 2684ac05a8c4 ("soc: imx: add i.MX8M blk-ctrl driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Reported-by: Advait Dhamorikar <advaitd@xxxxxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/CAAPs2HTo=4+AEw1+vcU6c9vt_O2BfF+gv3FFvx9G3KLLzCOsHw@xxxxxxxxxxxxxx/
> Closes: https://lore.kernel.org/all/fccbb040330a706a4f7b34875db1d896a0bf81c8.camel@xxxxxxxxx/
> Suggested-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> Co-developed-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
> Signed-off-by: Vitor Soares <vitor.soares@xxxxxxxxxxx>
Reviewed-by: Peng Fan <peng.fan@xxxxxxx>