From: sashiko-bot@kernel.org
To: "Wentao Liang" <vulab@iscas.ac.cn>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/bridge: microchip-lvds: Fix runtime PM leak in mchp_lvds_enable()
Date: Wed, 16 Sep 2026 10:29:01 +0000 [thread overview]
Message-ID: <20260916102902.151761F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916101922.2018259-1-vulab@iscas.ac.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/bridge: runtime PM usage counter underflow on atomic_enable error
--
commit f6da183dff281321349d56635d572cdbbecf6393
Author: Wentao Liang <vulab@iscas.ac.cn>
drm/bridge: microchip-lvds: Fix runtime PM leak in mchp_lvds_enable()
This patch attempts to fix a runtime PM usage counter leak in
mchp_lvds_atomic_enable() by dropping the reference when
pm_runtime_get_sync() fails.
> diff --git a/drivers/gpu/drm/bridge/microchip-lvds.c b/drivers/gpu/drm/bridge/microchip-lvds.c
> index dd4ffc9f4df3f..f30ebeea4a4da 100644
> --- a/drivers/gpu/drm/bridge/microchip-lvds.c
> +++ b/drivers/gpu/drm/bridge/microchip-lvds.c
> @@ -144,6 +144,7 @@ static void mchp_lvds_atomic_enable(struct drm_bridge *bridge,
> ret = pm_runtime_get_sync(lvds->dev);
> if (ret < 0) {
> dev_err(lvds->dev, "failed to get pm runtime: %d\n", ret);
> + pm_runtime_put_noidle(lvds->dev);
[Severity: Medium]
Will this lead to a runtime PM usage counter underflow when the bridge is
disabled?
The DRM bridge API's atomic_enable callback returns void, so the DRM core
cannot be notified of a failure. If pm_runtime_get_sync() fails, the DRM core
still considers the bridge enabled and will unconditionally call
mchp_lvds_atomic_disable() during the next modeset or pipeline teardown.
Since this patch locally drops the PM reference here on the error path, the
unconditional pm_runtime_put() in mchp_lvds_atomic_disable() will decrement
the usage count a second time, causing an underflow. Before this patch, the
reference left by the failing get_sync() balanced the unconditional put in
the disable path.
> return;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916101922.2018259-1-vulab@iscas.ac.cn?part=1
next prev parent 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:19 [PATCH] drm/bridge: microchip-lvds: Fix runtime PM leak in mchp_lvds_enable() Wentao Liang
2026-09-16 10:29 ` sashiko-bot [this message]
2026-09-17 11:06 ` Manikandan.M
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=20260916102902.151761F000FF@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.