All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, olteanv@gmail.com,
	vkoul@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org,
	linux-phy@lists.infradead.org
Subject: Re: [PATCH RFC/DO NOT MERGE 07/12] drm/msm/hdmi: Split PHY init from power up
Date: Mon, 7 Sep 2026 14:34:58 +0200	[thread overview]
Message-ID: <e1842799-2603-4f7a-b3db-623483bd4bd8@oss.qualcomm.com> (raw)
In-Reply-To: <20260828142231.81AD01F000E9@smtp.kernel.org>

On 28/08/2026 16:22, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
> 
> New issues:
> - [High] The HDMI pixel clock is disabled before the 20ms vblank delay, breaking the intended shutdown sequence and risking hardware hangs.
> - [Medium] Unconditional clock disable and PHY deinitialization can cause unbalanced clock teardown or CCF warnings.
> 
> Pre-existing issues:
> - [High] Hardware registers are accessed after dropping the runtime PM reference.
> - [High] Missing return value checks for hardware initialization functions, such as `pm_runtime_resume_and_get()` and `msm_hdmi_phy_resource_enable()`.
> --
> 
> commit 821f230494b55344c7aaf6bb73ba3e416ff8cb25
> Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Subject: drm/msm/hdmi: Split PHY init from power up
> 
> This commit reworks and splits the msm_hdmi_power_on() sequence into
> smaller steps. It separates out runtime PM enablement, introduces a new
> msm_hdmi_phy_init() step, and splits clock preparation and reparenting into
> msm_hdmi_clk_prepare() which runs after PHY initialization.
> 
>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
>> index 9d027f96ae243..ead6ba3b8192a 100644
>> --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
>> @@ -15,12 +15,18 @@
>>  
>>  static void msm_hdmi_power_on(struct drm_bridge *bridge)
>>  {
>> -	struct drm_device *dev = bridge->dev;
>>  	struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
>>  	struct hdmi *hdmi = hdmi_bridge->hdmi;
>> -	int ret;
>>  
>>  	pm_runtime_resume_and_get(&hdmi->pdev->dev);
> 
> [Severity: High]
> This is a pre-existing issue, but is it safe to ignore the return value of
> pm_runtime_resume_and_get() here?
> 
> If it fails, the power domain is not enabled and the PM usage count is not
> incremented. Proceeding to access hardware registers will cause an SError
> or panic, and the subsequent pm_runtime_put() in the disable path will
> underflow the usage count.

Addressed separately.

> 
>> +}
> 
> [ ... ]
> 
>> @@ -341,6 +359,8 @@ static void msm_hdmi_bridge_atomic_post_disable(struct drm_bridge *bridge,
>>  	msm_hdmi_set_mode(hdmi, hdmi->hpd_enabled);
>>  
>>  	msm_hdmi_phy_powerdown(phy);
>> +	msm_hdmi_clk_unprepare(bridge);
>> +	msm_hdmi_phy_deinit(phy);
>>  
>>  	if (hdmi->power_on) {
> 
> [Severity: Medium]
> Can this unconditional clock disable and PHY deinitialization cause
> unbalanced clock teardown or Common Clock Framework warnings?
> 
> If atomic_post_disable() is called to sanitize the hardware during initial
> modeset (where hdmi->power_on is false), msm_hdmi_clk_unprepare() will be
> called without a matching prior enable. This bypasses the state tracking
> guard and triggers a WARN in the CCF.

It's pre-existing approach but I will address it in v2.

> 
> [Severity: High]
> Does this code disable the HDMI pixel clock before the 20ms vblank delay
> inside power_off()?
> 
> Because msm_hdmi_clk_unprepare() is called before power_off(), the
> pipeline is frozen mid-frame before the delay executes. Powering down a
> frozen display controller mid-frame frequently causes system-wide bus hangs
> (AXI bus stalls) on ARM SoCs.

No, this is just pixel clock, not bus clocks.

> 
>>  		power_off(bridge);
> 
> [Severity: High]
> This is a pre-existing issue, but can the code following power_off() access
> hardware registers after the runtime PM reference has been dropped?

Ack


Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, olteanv@gmail.com,
	vkoul@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org,
	linux-phy@lists.infradead.org
Subject: Re: [PATCH RFC/DO NOT MERGE 07/12] drm/msm/hdmi: Split PHY init from power up
Date: Mon, 7 Sep 2026 14:34:58 +0200	[thread overview]
Message-ID: <e1842799-2603-4f7a-b3db-623483bd4bd8@oss.qualcomm.com> (raw)
In-Reply-To: <20260828142231.81AD01F000E9@smtp.kernel.org>

On 28/08/2026 16:22, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
> 
> New issues:
> - [High] The HDMI pixel clock is disabled before the 20ms vblank delay, breaking the intended shutdown sequence and risking hardware hangs.
> - [Medium] Unconditional clock disable and PHY deinitialization can cause unbalanced clock teardown or CCF warnings.
> 
> Pre-existing issues:
> - [High] Hardware registers are accessed after dropping the runtime PM reference.
> - [High] Missing return value checks for hardware initialization functions, such as `pm_runtime_resume_and_get()` and `msm_hdmi_phy_resource_enable()`.
> --
> 
> commit 821f230494b55344c7aaf6bb73ba3e416ff8cb25
> Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Subject: drm/msm/hdmi: Split PHY init from power up
> 
> This commit reworks and splits the msm_hdmi_power_on() sequence into
> smaller steps. It separates out runtime PM enablement, introduces a new
> msm_hdmi_phy_init() step, and splits clock preparation and reparenting into
> msm_hdmi_clk_prepare() which runs after PHY initialization.
> 
>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
>> index 9d027f96ae243..ead6ba3b8192a 100644
>> --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
>> @@ -15,12 +15,18 @@
>>  
>>  static void msm_hdmi_power_on(struct drm_bridge *bridge)
>>  {
>> -	struct drm_device *dev = bridge->dev;
>>  	struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
>>  	struct hdmi *hdmi = hdmi_bridge->hdmi;
>> -	int ret;
>>  
>>  	pm_runtime_resume_and_get(&hdmi->pdev->dev);
> 
> [Severity: High]
> This is a pre-existing issue, but is it safe to ignore the return value of
> pm_runtime_resume_and_get() here?
> 
> If it fails, the power domain is not enabled and the PM usage count is not
> incremented. Proceeding to access hardware registers will cause an SError
> or panic, and the subsequent pm_runtime_put() in the disable path will
> underflow the usage count.

Addressed separately.

> 
>> +}
> 
> [ ... ]
> 
>> @@ -341,6 +359,8 @@ static void msm_hdmi_bridge_atomic_post_disable(struct drm_bridge *bridge,
>>  	msm_hdmi_set_mode(hdmi, hdmi->hpd_enabled);
>>  
>>  	msm_hdmi_phy_powerdown(phy);
>> +	msm_hdmi_clk_unprepare(bridge);
>> +	msm_hdmi_phy_deinit(phy);
>>  
>>  	if (hdmi->power_on) {
> 
> [Severity: Medium]
> Can this unconditional clock disable and PHY deinitialization cause
> unbalanced clock teardown or Common Clock Framework warnings?
> 
> If atomic_post_disable() is called to sanitize the hardware during initial
> modeset (where hdmi->power_on is false), msm_hdmi_clk_unprepare() will be
> called without a matching prior enable. This bypasses the state tracking
> guard and triggers a WARN in the CCF.

It's pre-existing approach but I will address it in v2.

> 
> [Severity: High]
> Does this code disable the HDMI pixel clock before the 20ms vblank delay
> inside power_off()?
> 
> Because msm_hdmi_clk_unprepare() is called before power_off(), the
> pipeline is frozen mid-frame before the delay executes. Powering down a
> frozen display controller mid-frame frequently causes system-wide bus hangs
> (AXI bus stalls) on ARM SoCs.

No, this is just pixel clock, not bus clocks.

> 
>>  		power_off(bridge);
> 
> [Severity: High]
> This is a pre-existing issue, but can the code following power_off() access
> hardware registers after the runtime PM reference has been dropped?

Ack


Best regards,
Krzysztof

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-09-07 12:35 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 14:04 [PATCH RFC/DO NOT MERGE 00/12] drm/msm/hdmi: Add Eliza HDMI and HDMI PHY Krzysztof Kozlowski
2026-08-28 14:04 ` Krzysztof Kozlowski
2026-08-28 14:04 ` [PATCH RFC/DO NOT MERGE 01/12] drm/msm/hdmi_bridge: Drop redundant initialization in msm_hdmi_bridge_init() Krzysztof Kozlowski
2026-08-28 14:04   ` Krzysztof Kozlowski
2026-08-31 16:27   ` Konrad Dybcio
2026-08-31 16:27     ` Konrad Dybcio
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 02/12] drm/msm: Properly handle msm_ioremap() without name Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-31 16:27   ` Konrad Dybcio
2026-08-31 16:27     ` Konrad Dybcio
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 03/12] drm/msm/dsi: Fix indentation of if block in dsi_mgr_bridge_mode_valid() Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-31 16:28   ` Konrad Dybcio
2026-08-31 16:28     ` Konrad Dybcio
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 04/12] dt-bindings: display/msm: hdmi: Correct name of disallowed supplies Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-31 16:37   ` Konrad Dybcio
2026-08-31 16:37     ` Konrad Dybcio
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 05/12] dt-bindings: display/msm: hdmi: Add Eliza HDMI TX Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:12   ` sashiko-bot
2026-08-28 14:12     ` sashiko-bot
2026-08-31 13:53     ` Krzysztof Kozlowski
2026-08-31 13:53       ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 06/12] dt-bindings: display/msm: eliza-hdmi-phy: Add Eliza HDMI PHY Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:10   ` sashiko-bot
2026-08-28 14:10     ` sashiko-bot
2026-08-31 14:13     ` Krzysztof Kozlowski
2026-08-31 14:13       ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 07/12] drm/msm/hdmi: Split PHY init from power up Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:22   ` sashiko-bot
2026-08-28 14:22     ` sashiko-bot
2026-09-07 12:34     ` Krzysztof Kozlowski [this message]
2026-09-07 12:34       ` Krzysztof Kozlowski
2026-08-31 16:40   ` Konrad Dybcio
2026-08-31 16:40     ` Konrad Dybcio
2026-09-01  5:57     ` Krzysztof Kozlowski
2026-09-01  5:57       ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 08/12] drm/msm/hdmi: Add support for PM OPP table Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:16   ` sashiko-bot
2026-08-28 14:16     ` sashiko-bot
2026-09-07 13:03     ` Krzysztof Kozlowski
2026-09-07 13:03       ` Krzysztof Kozlowski
2026-08-31 16:43   ` Konrad Dybcio
2026-08-31 16:43     ` Konrad Dybcio
2026-09-01  5:58     ` Krzysztof Kozlowski
2026-09-01  5:58       ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 09/12] drm/msm/hdmi: Add HDMI for Eliza SoC Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:22   ` sashiko-bot
2026-08-28 14:22     ` sashiko-bot
2026-09-07 13:09     ` Krzysztof Kozlowski
2026-09-07 13:09       ` Krzysztof Kozlowski
2026-08-31 16:45   ` Konrad Dybcio
2026-08-31 16:45     ` Konrad Dybcio
2026-09-01  6:00     ` Krzysztof Kozlowski
2026-09-01  6:00       ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 10/12] drm/msm/hdmi_phy_eliza: Add support for Synopsys-based HDMI phy on Eliza Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:19   ` sashiko-bot
2026-08-28 14:19     ` sashiko-bot
2026-09-08 13:19     ` Krzysztof Kozlowski
2026-09-08 13:19       ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 11/12] arm64: dts: qcom: eliza: Add HDMI display with HDMI PHY Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 12/12] arm64: dts: qcom: eliza-evk: Add native HDMI Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski

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=e1842799-2603-4f7a-b3db-623483bd4bd8@oss.qualcomm.com \
    --to=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.