All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: yaolu@kylinos.cn
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: fix wrong plane_count check in dm_gpureset_toggle_interrupts()
Date: Thu, 23 Jul 2026 02:03:04 +0000	[thread overview]
Message-ID: <20260723020304.CF97A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260723015503.32122-1-yaolu@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The patch introduces a critical boolean logic error in `dm_gpureset_toggle_interrupts` that breaks DCN interrupt toggling during GPU reset.
--

--- Patch [1]: [PATCH] drm/amd/display: fix wrong plane_count check in dm_gpureset_toggle_interrupts() ---
commit 019af4e190dd8d0cacc73ad6b2cdd860d90cbb1b
Author: Lu Yao <yaolu@kylinos.cn>
drm/amd/display: fix wrong plane_count check in dm_gpureset_toggle_interrupts()

The else-if branch in dm_gpureset_toggle_interrupts() condition was incorrectly
checking plane_count != 0, which the author states is the same as the
preceding if-branch and can never be true in the else path.

> 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 f8d8132ea50ed..e3d490d27171f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1587,7 +1587,7 @@ static void dm_gpureset_toggle_interrupts(struct amdgpu_device *adev,
>  			if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))
>  				drm_warn(adev_to_drm(adev), "Failed to %sable vblank interrupt\n", enable ? "en" : "dis");
>  
> -		} else if (acrtc && state->stream_status[i].plane_count != 0) {
> +		} else if (acrtc && state->stream_status[i].plane_count == 0) {

[Severity: High]
Does this change unintentionally break interrupt toggling for DCN hardware?

The commit message states that the preceding if-branch already checks for
plane_count != 0, making it impossible to be true here. However, looking at
the preceding if-condition in dm_gpureset_toggle_interrupts():

		if (acrtc && state->stream_status[i].plane_count != 0 &&
		    amdgpu_ip_version(adev, DCE_HWIP, 0) == 0) {

The if-branch also requires amdgpu_ip_version(adev, DCE_HWIP, 0) == 0. For
DCN hardware, this IP version check evaluates to false, which causes the
execution to fall through to this else-if branch even when plane_count != 0.

With this patch changing the check to plane_count == 0, won't DCN streams
with active planes incorrectly skip toggling VUPDATE_NO_LOCK during a GPU
reset?

>  			/* DCN only needs to toggle VUPDATE_NO_LOCK */
>  			rc = amdgpu_dm_crtc_set_vupdate_irq(&acrtc->base, enable);
>  			if (rc)
>  				drm_warn(adev_to_drm(adev), "Failed to %sable vupdate interrupt\n",
>  					 enable ? "en" : "dis");
>  		}
>  	}
>  
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260723015503.32122-1-yaolu@kylinos.cn?part=1

      reply	other threads:[~2026-07-23  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  1:55 [PATCH] drm/amd/display: fix wrong plane_count check in dm_gpureset_toggle_interrupts() yaolu
2026-07-23  2:03 ` 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=20260723020304.CF97A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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 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.