Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 1/7] drm/msm/hdmi_phy: Cleanup after msm_hdmi_phy_resource_enable() failure
Date: Mon, 07 Sep 2026 13:06:33 +0000	[thread overview]
Message-ID: <20260907130633.E673D1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907-drm-msm-hdmi-fixes-before-eliza-v2-1-b097cf1eac77@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing regulator disable on the newly added clock enablement error path.
--

commit 89a12851603b82367d9387f6f70068a1f77f92b9
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

drm/msm/hdmi_phy: Cleanup after msm_hdmi_phy_resource_enable() failure

This commit adds an error cleanup path to msm_hdmi_phy_resource_enable()
to ensure resources are properly unwound if regulators or clocks fail to
enable.

> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
> index eb1088755cb3a..fd675f537f2b8 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
> @@ -67,16 +67,26 @@ int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy)
>  	ret = regulator_bulk_enable(cfg->num_regs, phy->regs);
>  	if (ret) {
>  		DRM_DEV_ERROR(dev, "failed to enable regulators: (%d)\n", ret);
> -		return ret;
> +		goto err_pm_put;
>  	}
>  
>  	for (i = 0; i < cfg->num_clks; i++) {
>  		ret = clk_prepare_enable(phy->clks[i]);
> -		if (ret)
> +		if (ret) {
>  			DRM_DEV_ERROR(dev, "failed to enable clock: %s (%d)\n",
>  				cfg->clk_names[i], ret);
> +			goto err_clk_unprepare;
> +		}
>  	}
>  
> +	return 0;
> +
> +err_clk_unprepare:
> +	for (; i > 0; i--)
> +		clk_disable_unprepare(phy->clks[i - 1]);
> +err_pm_put:
> +	pm_runtime_put_sync(dev);

[Severity: Medium]
Does this new error path leak the regulator enable count?

If clk_prepare_enable() fails, the code jumps to err_clk_unprepare,
unwinds the clocks, and drops the PM runtime reference at err_pm_put.
However, it appears to skip calling regulator_bulk_disable() for the
regulators that were successfully enabled earlier in the function.

>  	return ret;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-drm-msm-hdmi-fixes-before-eliza-v2-0-b097cf1eac77@oss.qualcomm.com?part=1

  reply	other threads:[~2026-09-07 13:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 13:00 [PATCH v2 0/7] drm/msm/hdmi: Fixes/Cleanups before Eliza Krzysztof Kozlowski
2026-09-07 13:00 ` [PATCH v2 1/7] drm/msm/hdmi_phy: Cleanup after msm_hdmi_phy_resource_enable() failure Krzysztof Kozlowski
2026-09-07 13:06   ` sashiko-bot [this message]
2026-09-07 13:17     ` Krzysztof Kozlowski
2026-09-07 13:00 ` [PATCH v2 2/7] drm/msm/hdmi: Handle msm_hdmi_power_on() errors during .atomic_pre_enable() Krzysztof Kozlowski
2026-09-07 13:14   ` sashiko-bot
2026-09-07 13:19     ` Krzysztof Kozlowski
2026-09-07 13:00 ` [PATCH v2 3/7] drm/msm/hdmi_bridge: Correct poweroff/audio cleanup order in post_disable Krzysztof Kozlowski
2026-09-07 13:11   ` sashiko-bot
2026-09-07 13:21     ` Krzysztof Kozlowski
2026-09-07 13:00 ` [PATCH v2 4/7] drm/msm/hdmi_bridge: Drop redundant initialization in msm_hdmi_bridge_init() Krzysztof Kozlowski
2026-09-07 13:00 ` [PATCH v2 5/7] drm/msm: Properly handle msm_ioremap() without name Krzysztof Kozlowski
2026-09-07 13:36   ` Abel Vesa
2026-09-07 13:00 ` [PATCH v2 6/7] drm/msm/dsi: Fix indentation of if block in dsi_mgr_bridge_mode_valid() Krzysztof Kozlowski
2026-09-07 13:00 ` [PATCH v2 7/7] dt-bindings: display/msm: hdmi: Correct name of disallowed supplies 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=20260907130633.E673D1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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