mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: lyude@redhat.com
To: Wentao Liang <vulab@iscas.ac.cn>, airlied@gmail.com
Cc: bskeggs@redhat.com, dakr@kernel.org,
	dri-devel@lists.freedesktop.org,  linux-kernel@vger.kernel.org,
	maarten.lankhorst@linux.intel.com,  mripard@kernel.org,
	nouveau@lists.freedesktop.org, simona@ffwll.ch,
	 tzimmermann@suse.de, stable@vger.kernel.org
Subject: Re: [PATCH] drm/nouveau: Fix runtime PM leak in nouveau_connector_detect()
Date: Thu, 17 Sep 2026 14:23:24 -0400	[thread overview]
Message-ID: <fc7bae477fdeab0bcbb908863b4f434dc03844f2.camel@redhat.com> (raw)
In-Reply-To: <20260916180342.2090360-1-vulab@iscas.ac.cn>

Nice catch!

Reviewed-by: Lyude Paul <lyude@redhat.com>

Will push to drm-misc-fixes in just a moment

On Wed, 2026-09-16 at 18:03 +0000, Wentao Liang wrote:
> If nvif_outp_edid_get() fails, nouveau_connector_detect() returns
> early without dropping the runtime PM reference taken at the start
> of the function, keeping the device powered on until the next
> successful detect.
> 
> Balance the reference on the error path like the other exit paths
> do.
> 
> Fixes: 0cd7e0718139 ("drm/nouveau/disp: add output method to fetch
> edid")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/gpu/drm/nouveau/nouveau_connector.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c
> b/drivers/gpu/drm/nouveau/nouveau_connector.c
> index cc239492c7f0..4a750d4bf1f4 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
> @@ -600,8 +600,11 @@ nouveau_connector_detect(struct drm_connector
> *connector, bool force)
>  				new_edid = drm_get_edid(connector,
> nv_encoder->i2c);
>  		} else {
>  			ret = nvif_outp_edid_get(&nv_encoder->outp,
> (u8 **)&new_edid);
> -			if (ret < 0)
> +			if (ret < 0) {
> +				pm_runtime_mark_last_busy(dev->dev);
> +				pm_runtime_put_autosuspend(dev-
> >dev);
>  				return
> connector_status_disconnected;
> +			}
>  		}
>  
>  		nouveau_connector_set_edid(nv_connector, new_edid);


      reply	other threads:[~2026-09-17 18:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 18:03 Wentao Liang
2026-09-17 18:23 ` lyude [this message]

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=fc7bae477fdeab0bcbb908863b4f434dc03844f2.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=airlied@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    --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 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®