From: Harry Wentland <harry.wentland@amd.com>
To: 2564278112@qq.com
Cc: "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>,
amd-gfx@lists.freedesktop.org, "Alex Hung" <alex.hung@amd.com>,
"Mario Limonciello" <superm1@kernel.org>,
"Timur Kristóf" <timur.kristof@gmail.com>,
"Ray Wu" <ray.wu@amd.com>, "Ivan Lipski" <ivan.lipski@amd.com>,
"Lu Yao" <yaolu@kylinos.cn>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
"Wang Jiang" <jiangwang@kylinos.cn>
Subject: Re: [PATCH] drm/amd/display: Don't ignore dc_commit_streams() failures
Date: Tue, 20 Oct 2026 10:44:58 -0400 [thread overview]
Message-ID: <11ad129a-3e7f-4a77-9c4e-58f6681e1359@amd.com> (raw)
In-Reply-To: <tencent_34284E790157CA20C27C9260A7A32C08C10A@qq.com>
On 10/8/26 03:17, 2564278112@qq.com wrote:
> From: Wang Jiang <jiangwang@kylinos.cn>
>
> dc_commit_streams() can fail and leave the streams half committed, but
> amdgpu_dm_commit_streams() and the reset recovery path in dm_resume()
> only emitted a WARN_ON() and continued. The planes are then programmed
> against a stream list that the hardware never took, which turns a
> recoverable commit failure into a crash.
>
> Log the failure and stop programming further stream/plane state in
> amdgpu_dm_commit_streams(). In dm_resume(), keep the WARN_ON_ONCE() for
> the stack trace, but continue the reset recovery as before.
>
> Signed-off-by: Wang Jiang <jiangwang@kylinos.cn>
Please look at and respond to the sashiko comments. They highlight
some of the problems with an early return without additional cleanup.
Harry
> ---
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 20 +++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> 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 c4c8904fea42..d88bd89da840 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1916,7 +1916,12 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
> commit_params.streams = dc_state->streams;
> commit_params.stream_count = dc_state->stream_count;
> dc_exit_ips_for_hw_access(dm->dc);
> - WARN_ON(!dc_commit_streams(dm->dc, &commit_params));
> + if (dc_commit_streams(dm->dc, &commit_params) != DC_OK) {
> + drm_err(adev_to_drm(adev),
> + "DC failed to commit %u stream(s) during reset recovery\n",
> + (unsigned int)commit_params.stream_count);
> + WARN_ON_ONCE(1);
> + }
>
> dm_gpureset_commit_state(dm->cached_dc_state, dm);
>
> @@ -4619,7 +4624,18 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_commit *state,
> dm_enable_per_frame_crtc_master_sync(dc_state);
> mutex_lock(&dm->dc_lock);
> dc_exit_ips_for_hw_access(dm->dc);
> - WARN_ON(!dc_commit_streams(dm->dc, ¶ms));
> + if (dc_commit_streams(dm->dc, ¶ms) != DC_OK) {
> + mutex_unlock(&dm->dc_lock);
> + /*
> + * DC refused the stream list, so the hardware and the DC state
> + * no longer agree. Bail out instead of programming more
> + * stream/plane state for a half committed stream list (this
> + * used to be a silently ignored WARN_ON()).
> + */
> + drm_err(dev, "DC failed to commit %u stream(s)\n",
> + (unsigned int)params.stream_count);
> + return;
> + }
>
> bool frl_stream_found = false;
prev parent reply other threads:[~2026-10-20 14:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261008071700.552056-1-2564278112@qq.com>
2026-10-08 7:17 ` 2564278112
2026-10-20 14:44 ` Harry Wentland [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=11ad129a-3e7f-4a77-9c4e-58f6681e1359@amd.com \
--to=harry.wentland@amd.com \
--cc=2564278112@qq.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ivan.lipski@amd.com \
--cc=jiangwang@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=ray.wu@amd.com \
--cc=simona@ffwll.ch \
--cc=siqueira@igalia.com \
--cc=sunpeng.li@amd.com \
--cc=superm1@kernel.org \
--cc=timur.kristof@gmail.com \
--cc=yaolu@kylinos.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®