mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wentao Liang <vulab@iscas.ac.cn>
To: Laurent.pinchart@ideasonboard.com
Cc: airlied@gmail.com, andrzej.hajda@intel.com,
	dharma.b@microchip.com, dri-devel@lists.freedesktop.org,
	hari.prasathge@microchip.com, jernej.skrabec@gmail.com,
	jonas@kwiboo.se, linux-kernel@vger.kernel.org, lumag@kernel.org,
	maarten.lankhorst@linux.intel.com, manikandan.m@microchip.com,
	mripard@kernel.org, neil.armstrong@linaro.org, rfoss@kernel.org,
	simona@ffwll.ch, tzimmermann@suse.de,
	Wentao Liang <vulab@iscas.ac.cn>,
	stable@vger.kernel.org
Subject: [PATCH] drm/bridge: microchip-lvds: Fix runtime PM leak in mchp_lvds_enable()
Date: Wed, 16 Sep 2026 10:19:22 +0000	[thread overview]
Message-ID: <20260916101922.2018259-1-vulab@iscas.ac.cn> (raw)

mchp_lvds_enable() resumes the device with pm_runtime_get_sync() and
returns early when the resume fails.  pm_runtime_get_sync() increments
the runtime PM usage count even when it fails, so returning without
dropping the reference leaks it and prevents the device from ever
suspending again once the error has been hit.

Drop the runtime PM reference with pm_runtime_put_noidle() on the
resume failure path before returning.

Fixes: 179b0769fc5f ("drm/bridge: add lvds controller support for sam9x7")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/gpu/drm/bridge/microchip-lvds.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/bridge/microchip-lvds.c b/drivers/gpu/drm/bridge/microchip-lvds.c
index 9f4ff82bc6b4..b77ec6ae0a97 100644
--- a/drivers/gpu/drm/bridge/microchip-lvds.c
+++ b/drivers/gpu/drm/bridge/microchip-lvds.c
@@ -127,6 +127,7 @@ static void mchp_lvds_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);
 		return;
 	}
 
-- 
2.34.1


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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 10:19 Wentao Liang [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=20260916101922.2018259-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dharma.b@microchip.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hari.prasathge@microchip.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=manikandan.m@microchip.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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®