All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wentao Liang" <vulab@iscas.ac.cn>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/mali-dp: Fix runtime PM leak in malidp_crtc_atomic_enable()
Date: Wed, 16 Sep 2026 10:29:47 +0000	[thread overview]
Message-ID: <20260916102947.C1A821F00899@smtp.kernel.org> (raw)
In-Reply-To: <20260916102112.2018372-1-vulab@iscas.ac.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/malidp: runtime PM usage counter underflow in malidp_crtc_atomic_disable()
--

commit 3492dcc2c28d3962cf4a64dc34d1fb164aaf6580
Author: Wentao Liang <vulab@iscas.ac.cn>

drm/mali-dp: Fix runtime PM leak in malidp_crtc_atomic_enable()

This patch drops the runtime PM reference with pm_runtime_put_noidle() on
the resume failure path in malidp_crtc_atomic_enable(). This is intended
to fix a reference leak when pm_runtime_get_sync() fails.

> diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c
> index 157ff148efe7a..ec7b9db8b0b45 100644
> --- a/drivers/gpu/drm/arm/malidp_crtc.c
> +++ b/drivers/gpu/drm/arm/malidp_crtc.c
> @@ -56,6 +56,7 @@ static void malidp_crtc_atomic_enable(struct drm_crtc *crtc,
>  
>  	if (err < 0) {
>  		DRM_DEBUG_DRIVER("Failed to enable runtime power management: %d\n", err);
> +		pm_runtime_put_noidle(crtc->dev->dev);

[Severity: High]
Could this addition cause a runtime PM usage counter underflow when the CRTC
is later disabled?

Because malidp_crtc_atomic_enable() returns void, the DRM core still
considers the CRTC active even if it returns early on error here. When the
CRTC is later disabled, malidp_crtc_atomic_disable() will be unconditionally
called, which executes its own pm_runtime_put():

drivers/gpu/drm/arm/malidp_crtc.c:malidp_crtc_atomic_disable() {
	...
	clk_disable_unprepare(hwdev->pxlclk);

	pm_runtime_put(crtc->dev->dev);
}

If we drop the PM reference here on the error path, wouldn't the later call
to pm_runtime_put() in malidp_crtc_atomic_disable() result in a double-put
and underflow the PM usage counter?

>  		return;
>  	}
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260916102112.2018372-1-vulab@iscas.ac.cn?part=1

  reply	other threads:[~2026-09-16 10:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 10:21 [PATCH] drm/mali-dp: Fix runtime PM leak in malidp_crtc_atomic_enable() Wentao Liang
2026-09-16 10:29 ` sashiko-bot [this message]
2026-09-16 12:47 ` Liviu Dudau

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=20260916102947.C1A821F00899@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vulab@iscas.ac.cn \
    /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.