mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: "Linkai Gong" <gonglinkai@kylinos.cn>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>
Cc: "Mario Limonciello" <mario.limonciello@amd.com>,
	"Alex Hung" <alex.hung@amd.com>,
	"Timur Kristóf" <timur.kristof@gmail.com>,
	"Ivan Lipski" <ivan.lipski@amd.com>, "Ray Wu" <ray.wu@amd.com>,
	"Chenyu Chen" <chen-yu.chen@amd.com>,
	"Wayne Lin" <Wayne.Lin@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: fix dc_lock leak on GPU reset error paths
Date: Thu, 20 Aug 2026 15:26:17 -0500	[thread overview]
Message-ID: <fc704cf9-4bc5-4c67-9705-1eaf84c41102@kernel.org> (raw)
In-Reply-To: <20260819054742.3143856-1-gonglinkai@kylinos.cn>

On 8/19/26 00:47, Linkai Gong wrote:
> On GPU reset, dm_suspend() takes dc_lock and leaves it for dm_resume()
> to drop. If amdgpu_dm_commit_zero_streams() or dm_dmub_hw_init() fails,
> the function returns with the lock still held. The matching resume path
> is then skipped, so every later dc_lock take hangs.
> 
> Release the cached DC state and unlock before returning the error.
> 
> Fixes: 3cf7a0bc87f0 ("drm/amd/display: Catch failures for amdgpu_dm_commit_zero_streams()")
> Fixes: 2b6943df5413 ("drm/amd/display: Pass up errors for reset GPU that fails to init HW")
> Cc: stable@vger.kernel.org
> Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>

Great finding and fix.  I'll get this added to amd-staging-drm-next.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 941c1a312824..214aca906fe1 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3511,6 +3511,9 @@ static int dm_suspend(struct amdgpu_ip_block *ip_block)
>   		res = amdgpu_dm_commit_zero_streams(dm->dc);
>   		if (res != DC_OK) {
>   			drm_err(adev_to_drm(adev), "Failed to commit zero streams: %d\n", res);
> +			dc_state_release(dm->cached_dc_state);
> +			dm->cached_dc_state = NULL;
> +			mutex_unlock(&dm->dc_lock);
>   			return -EINVAL;
>   		}
>   
> @@ -3824,6 +3827,9 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
>   		r = dm_dmub_hw_init(adev);
>   		if (r) {
>   			drm_err(adev_to_drm(adev), "DMUB interface failed to initialize: status=%d\n", r);
> +			dc_state_release(dm->cached_dc_state);
> +			dm->cached_dc_state = NULL;
> +			mutex_unlock(&dm->dc_lock);
>   			return r;
>   		}
>   


      reply	other threads:[~2026-08-20 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19  5:47 Linkai Gong
2026-08-20 20:26 ` Mario Limonciello [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=fc704cf9-4bc5-4c67-9705-1eaf84c41102@kernel.org \
    --to=superm1@kernel.org \
    --cc=Wayne.Lin@amd.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=chen-yu.chen@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gonglinkai@kylinos.cn \
    --cc=harry.wentland@amd.com \
    --cc=ivan.lipski@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=ray.wu@amd.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=stable@vger.kernel.org \
    --cc=sunpeng.li@amd.com \
    --cc=timur.kristof@gmail.com \
    /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®