All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: 2564278112@qq.com
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: Don't ignore dc_commit_streams() failures
Date: Thu, 08 Oct 2026 07:38:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-163773@kernel.org> (raw)
In-Reply-To: <tencent_34284E790157CA20C27C9260A7A32C08C10A@qq.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/amd: incomplete fix, plane programming still executes after commit failure
- [Medium] drm/amd/display: hdmi_frl_status_polling_work leaks on commit failure
--

commit 5df85d959754dc46c8ae54787ba1fc6639162940
Author: Wang Jiang <jiangwang@kylinos.cn>

drm/amd/display: Don't ignore dc_commit_streams() failures

This patch modifies the AMD DRM driver to stop ignoring failures from
dc_commit_streams(). It logs the failure and adds an early return in
amdgpu_dm_commit_streams() to avoid programming plane state against a
half-committed stream list. It also logs failures in the reset recovery
path in dm_resume().

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

[ ... ]

> @@ -4735,7 +4740,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, &params));
> +	if (dc_commit_streams(dm->dc, &params) != 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;

[Severity: High]
Will this early return successfully stop the plane programming?

Since amdgpu_dm_commit_streams() returns void, it cannot propagate this
failure state back to its caller. Looking at the caller
amdgpu_dm_atomic_commit_tail():

amdgpu_dm_atomic_commit_tail() {
        ...
        if (dm_state && dm_state->context) {
                dc_state = dm_state->context;
                amdgpu_dm_commit_streams(state, dc_state);
        }
        ...
        if (dm_new_crtc_state->stream)
                amdgpu_dm_commit_planes(state, dev, dm, crtc, wait_for_vblank);
}

Because the tail continues unconditionally, won't it still program the
planes against the rejected stream list, resulting in the exact crash
this patch intended to prevent?

[Severity: Medium]
Does this early return cause the HDMI FRL status polling work to leak?

By returning early, we bypass the subsequent block that manages the FRL
polling work:

        if (frl_stream_found) {
                queue_delayed_work(...)
        } else {
                if (cancel_delayed_work_sync(&dm->hdmi_frl_status_polling_work))
                        ...
        }

Looking at hdmi_frl_status_polling_work(), the handler unconditionally
re-arms itself by calling queue_delayed_work() at the end of its execution.
If we fail the stream commit and return early, doesn't it leave the delayed
work to run and wake up the CPU indefinitely on a recoverable failure path?

> +	}
>  
>  	bool frl_stream_found = false;
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_34284E790157CA20C27C9260A7A32C08C10A@qq.com?part=1

      reply	other threads:[~2026-10-08  7:38 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 ` [PATCH] drm/amd/display: Don't ignore dc_commit_streams() failures 2564278112
2026-10-08  7:38   ` sashiko-bot [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=sashiko-outbox-163773@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=2564278112@qq.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.