mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-phy@lists.infradead.org, dri-devel@lists.freedesktop.org,
	robh@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org,
	vkoul@kernel.org, olteanv@gmail.com
Subject: Re: [PATCH 06/10] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
Date: Thu, 19 Nov 2026 16:30:02 +0100	[thread overview]
Message-ID: <ec9c8460-a8de-460e-92bb-dc03240152bb@aliel.fr> (raw)
In-Reply-To: <sashiko-outbox-219570@kernel.org>

On 11/17/26 21:11, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [High] drm/meson: dw-hdmi: skipped HDMITX mem PD power-up in
>   meson_dw_hdmi_init()
> --
> 
> commit c8e782099f758bf635402705a20f57d7df9682a7
> Author: Ronald Claveau <linux-kernel-dev@aliel.fr>
> 
> drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
> 
> This commit removes the direct HHI_HDMI_CLK_CNTL and HHI_MEM_PD_REG0
> register writes in meson_dw_hdmi_init() and takes a runtime PM reference
> in meson_dw_hdmi_probe() to power on the VPU power domain.
> 
>> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
>> index eb33c70f29c31..20a821936b3af 100644
>> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
>> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> [ ... ]
>> @@ -599,12 +598,6 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
>>  {
>>  	struct meson_drm *priv = meson_dw_hdmi->priv;
>>  
>> -	/* Enable clocks */
>> -	regmap_update_bits(priv->hhi, HHI_HDMI_CLK_CNTL, 0xffff, 0x100);
>> -
>> -	/* Bring HDMITX MEM output of power down */
>> -	regmap_update_bits(priv->hhi, HHI_MEM_PD_REG0, 0xff << 8, 0);
>> -
>>  	/* Reset HDMITX APB & TX & PHY */
>>  	reset_control_reset(meson_dw_hdmi->hdmitx_apb);
>>  	reset_control_reset(meson_dw_hdmi->hdmitx_ctrl);
>> @@ -829,9 +822,29 @@ static int __maybe_unused meson_dw_hdmi_pm_resume(struct device *dev)
>>  	return 0;
>>  }
>>  
>> +static void meson_dw_hdmi_pm_put(void *dev)
>> +{
>> +	pm_runtime_put_sync(dev);
>> +}
>> +
>>  static int meson_dw_hdmi_probe(struct platform_device *pdev)
>>  {
>> -	return component_add(&pdev->dev, &meson_dw_hdmi_ops);
>> +	struct device *dev = &pdev->dev;
>> +	int ret;
>> +
>> +	ret = devm_pm_runtime_enable(dev);
>> +	if (ret)
>> +		return ret;
>> +
>> +	ret = pm_runtime_resume_and_get(dev);
>> +	if (ret)
>> +		return dev_err_probe(dev, ret, "Failed to power on HDMI TX\n");
> 
> [Severity: High]
> Can dropping the HHI_MEM_PD_REG0 write leave the HDMITX memory powered
> down when the bootloader turns on the top-level VPU domain without
> enabling HDMI?
> 
> In the VPU power domain driver, pwrc_ee_is_powered_off() only checks the
> top-level AO sleep bit and does not check HHI_MEM_PD_REG0[15:8].  When
> the top-level VPU domain is already powered on at boot,
> meson_ee_pwrc_init_domain() registers the genpd as already on without
> calling meson_ee_pwrc_on():
> 
> drivers/pmdomain/amlogic/meson-ee-pwrc.c:meson_ee_pwrc_init_domain() {
> 	...
> 	if (dom->num_clks && dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) {
> 		ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
> 		if (ret)
> 			return ret;
> 
> 		dom->base.flags = GENPD_FLAG_ALWAYS_ON;
> 		ret = pm_genpd_init(&dom->base, NULL, false);
> 		if (ret)
> 			return ret;
> 	}
> 	...
> }
> 
> Because the genpd is initialized in the ON state with
> GENPD_FLAG_ALWAYS_ON, pm_runtime_resume_and_get() is a no-op and
> meson_ee_pwrc_on() never runs to clear HHI_MEM_PD_REG0[15:8], leaving
> HDMITX memory powered down when meson_dw_hdmi_init() and dw_hdmi_probe()
> access the controller.
> 

I will add a new patch with a function to release the memories power off
bits in v2.

> In addition, power-domains and assigned-clocks are optional in the
> amlogic,meson-dw-hdmi binding and were only added to in-tree DTs in
> v6.11, so dropping the HHI_HDMI_CLK_CNTL and HHI_MEM_PD_REG0 writes also
> regresses older DTBs (where meson_vclk_set() only configures
> HHI_HDMI_CLK_CNTL later at atomic_enable time) and builds with CONFIG_PM
> disabled.
> 

I will add a depends on PM in v2.

-- 
Best regards,
Ronald

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-11-19 15:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 01/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 02/10] dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 03/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
2026-11-17 19:39   ` sashiko-bot
2026-11-17 19:33 ` [PATCH 04/10] phy: amlogic: Add Meson HDMI TX PHY driver Ronald Claveau via B4 Relay
2026-11-17 19:58   ` sashiko-bot
2026-11-19 16:29     ` Ronald Claveau
2026-11-17 19:33 ` [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names Ronald Claveau via B4 Relay
2026-11-18 12:34   ` Neil Armstrong
2026-11-18 19:10     ` linux-kernel-dev
2026-11-17 19:33 ` [PATCH 06/10] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
2026-11-17 20:11   ` sashiko-bot
2026-11-19 15:30     ` Ronald Claveau [this message]
2026-11-17 19:33 ` [PATCH 07/10] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
2026-11-17 20:03   ` sashiko-bot
2026-11-20 17:52     ` Ronald Claveau
2026-11-17 19:33 ` [PATCH 08/10] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 09/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 10/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
2026-11-18 12:38 ` [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
2026-11-18 19:35   ` linux-kernel-dev
2026-11-19  7:58     ` Neil Armstrong
2026-11-19 15:33       ` linux-kernel-dev

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=ec9c8460-a8de-460e-92bb-dc03240152bb@aliel.fr \
    --to=linux-kernel-dev@aliel.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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

all inboxes | Powered by JetHome®