Re: [PATCH v4 06/11] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains

From: Ulf Hansson

Date: Thu Nov 26 2026 - 07:04:37 EST


On Mon, Nov 23, 2026 at 8:38 PM Ronald Claveau via B4 Relay
<devnull+linux-kernel-dev.aliel.fr@xxxxxxxxxx> wrote:
>
> From: Ronald Claveau <linux-kernel-dev@xxxxxxxx>
>
> When a power domain is found already powered on at probe time (typically
> the VPU domain left enabled by the bootloader), the driver registers the
> genpd in the ON state with GENPD_FLAG_ALWAYS_ON and never calls
> meson_ee_pwrc_on(). As a result, the memory power-down bits of the domain
> are not touched.
>
> pwrc_ee_is_powered_off() only checks the top-level sleep bit, so a
> bootloader that enabled the VPU without waking every memory block
> leaves those memories powered down, and nothing in the genpd framework
> will wake them since pm_runtime_resume_and_get() is a no-op for an
> always-on domain.
>
> This is a preparatory change: a following patch drops the explicit
> HHI_MEM_PD_REG0 write from the meson_dw_hdmi driver, which relies on the
> power domain to power the HDMITX memory.

A question, is the target to drop the GENPD_FLAG_ALWAYS_ON bit for
these PM domains, once the consumer drivers have received proper
support for runtime PM?

In any case, this looks good to me! Do you want me to apply this via
my pmdomain tree?

Kind regards
Uffe

>
> Signed-off-by: Ronald Claveau <linux-kernel-dev@xxxxxxxx>
> ---
> drivers/pmdomain/amlogic/meson-ee-pwrc.c | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> index 338f70d77bf0..b3ae5cd7bea8 100644
> --- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> +++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> @@ -392,11 +392,21 @@ static int meson_ee_pwrc_off(struct generic_pm_domain *domain)
> return 0;
> }
>
> +static void meson_ee_pwrc_mem_power_up(struct meson_ee_pwrc_domain *dom)
> +{
> + int i;
> +
> + for (i = 0; i < dom->desc.mem_pd_count; i++)
> + regmap_update_bits(dom->pwrc->regmap_hhi,
> + dom->desc.mem_pd[i].reg,
> + dom->desc.mem_pd[i].mask, 0);
> +}
> +
> static int meson_ee_pwrc_on(struct generic_pm_domain *domain)
> {
> struct meson_ee_pwrc_domain *pwrc_domain =
> container_of(domain, struct meson_ee_pwrc_domain, base);
> - int i, ret;
> + int ret;
>
> if (pwrc_domain->desc.top_pd)
> regmap_update_bits(pwrc_domain->pwrc->regmap_ao,
> @@ -404,10 +414,7 @@ static int meson_ee_pwrc_on(struct generic_pm_domain *domain)
> pwrc_domain->desc.top_pd->sleep_mask, 0);
> udelay(20);
>
> - for (i = 0 ; i < pwrc_domain->desc.mem_pd_count ; ++i)
> - regmap_update_bits(pwrc_domain->pwrc->regmap_hhi,
> - pwrc_domain->desc.mem_pd[i].reg,
> - pwrc_domain->desc.mem_pd[i].mask, 0);
> + meson_ee_pwrc_mem_power_up(pwrc_domain);
>
> udelay(20);
>
> @@ -478,6 +485,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
> * prepare/enable counters won't be in sync.
> */
> if (dom->num_clks && dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) {
> + meson_ee_pwrc_mem_power_up(dom);
> +
> ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
> if (ret)
> return ret;
>
> --
> 2.56.1
>
>