AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matt Turner" <mattst88@gmail.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset
Date: Wed, 02 Dec 2026 22:48:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-246695@kernel.org> (raw)
In-Reply-To: <20261202-amdgpu-devcoredump-fixes-v1-3-59f622a29769@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/amdgpu: amdgpu_gfx_disable_kgq() skips post-reset unmap
  on GFX11
--

commit 0c68dfc74c61f610dfe69cfef805b4a5d17edd1f
Author: Matt Turner <mattst88@gmail.com>

drm/amdgpu: don't unmap legacy queues through MES during reset

This commit skips the MES legacy queue unmap in amdgpu_gfx_disable_kcq()
and amdgpu_gfx_disable_kgq() when a GPU reset is in progress.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index c5a2dcff5058a..0e9456b57577b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
[ ... ]
> @@ -636,6 +640,10 @@ int amdgpu_gfx_disable_kgq(struct amdgpu_device *adev, int xcc_id)
>  	int j;
>  
>  	if (adev->enable_mes) {
> +		/* As below for KIQ: the reset tears down and rebuilds the queues. */
> +		if (amdgpu_in_reset(adev))
> +			return 0;
> +
>  		if (amdgpu_gfx_is_master_xcc(adev, xcc_id)) {
>  			for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
>  				j = i + xcc_id * adev->gfx.num_gfx_rings;

[Severity: Medium]
Does returning early when amdgpu_in_reset(adev) is true prevent
gfx_v11_0_cp_resume() from unmapping the temporary gfx_ring[0] during
post-reset resume when adev->gfx.disable_kq is set?

During GPU recovery, amdgpu_device_gpu_recover() holds the reset domain
lock (keeping in_gpu_reset set to 1) across amdgpu_device_asic_reset(),
including post-reset IP reinitialization in
amdgpu_device_reinit_after_reset() -> ... -> gfx_v11_0_cp_resume().  When
adev->gfx.disable_kq is true, gfx_v11_0_cp_resume() temporarily maps
gfx_ring[0] via amdgpu_gfx_enable_kgq() to initialize clear state and
then immediately calls amdgpu_gfx_disable_kgq(adev, 0) to unmap it:

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:gfx_v11_0_cp_resume() {
    ...
	if (adev->gfx.disable_kq) {
		for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
			ring = &adev->gfx.gfx_ring[i];
			/* we don't want to set ring->ready */
			r = amdgpu_ring_test_ring(ring);
			if (r)
				return r;
		}
		amdgpu_gfx_disable_kgq(adev, 0);
	}
    ...
}

Because amdgpu_in_reset(adev) is still true at that point,
amdgpu_gfx_disable_kgq() now returns early without calling
amdgpu_mes_unmap_legacy_queue().  That leaves gfx_ring[0] mapped on an HQD
that amdgpu_mes_init() did not reserve for kernel queues and instead
exposed in adev->mes.gfx_hqd_mask for MES user queues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-amdgpu-devcoredump-fixes-v1-0-59f622a29769@gmail.com?part=3

      reply	other threads:[~2026-12-02 22:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 22:34 [PATCH 0/3] drm/amdgpu: devcoredump and reset fixes Matt Turner
2026-12-02 22:34 ` [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump Matt Turner
2026-12-02 22:53   ` sashiko-bot
2026-12-02 22:34 ` [PATCH 2/3] drm/amdgpu: clear stale JPEG and VCN1 IP dump pointers Matt Turner
2026-12-02 22:34 ` [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset Matt Turner
2026-12-02 22:48   ` 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-246695@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mattst88@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox