From: sashiko-bot@kernel.org
To: "Frank Min" <Frank.Min@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/9] drm/amdgpu: disable gfx 13 pipe 1 ring
Date: Fri, 04 Dec 2026 14:55:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-250030@kernel.org> (raw)
In-Reply-To: <20261204142408.988734-2-Frank.Min@amd.com>
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] drm/amdgpu: amdgpu_gmc_allocate_vm_inv_eng() breaks gfx_ring[1]
on GFX10/11
- [Medium] drm/amdgpu: gfx_v13_0_gfx_ring_init() leaves gfx_ring[1]
re-enableable
- [Medium] drm/amdgpu: gfx_v13_0_hw_init() clears
gfx_ring[1].sched.ready too late
- [Low] drm/amdgpu: commit message lacks rationale for disabling gfx13
pipe 1
--
commit 99b1a1cd968d2f39334b32d40212198583f21ae0
Author: Frank Min <Frank.Min@amd.com>
> drm/amdgpu: disable gfx 13 pipe 1 ring
>
> Disable gfx13 pipe 1 ring usage from the driver.
>
> Signed-off-by: Frank Min <Frank.Min@amd.com>
> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
[Severity: Low]
Could the commit message explain why gfx13 pipe 1 ring needs to be disabled?
It currently only restates the subject, without saying why gfx_ring[1]
remains initialized and ring-tested in hardware or why the shared
amdgpu_gmc_allocate_vm_inv_eng() path is changed.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index 12165f20a2c73..c7d7467730998 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -670,7 +670,8 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
> ring == &adev->mes.ring[1] ||
> ring == &adev->umsch_mm.ring ||
> ring == &adev->cper.ring_buf ||
> - ring == &adev->gfx.kiq[0].ring)
> + ring == &adev->gfx.kiq[0].ring ||
> + ring == &adev->gfx.gfx_ring[1])
> continue;
[Severity: High]
Does unconditionally skipping gfx_ring[1] here break active pipe 1 rings on
GFX 10.3 and GFX 11?
amdgpu_gmc_allocate_vm_inv_eng() is shared across GMC generations. On
GFX 10.3 (and GFX 11 with kernel queues enabled and RS64/TMZ disabled),
gfx_ring[1] is still an active scheduled ring on AMDGPU_GFXHUB(0).
Skipping it leaves gfx_ring[1].vm_inv_eng at 0, aliasing gfx_ring[0].
Because AMDGPU_GFXHUB(0) flushes in gmc_v10_0_emit_flush_gpu_tlb() and
gmc_v11_0_emit_flush_gpu_tlb() do not use hardware semaphores, concurrent
submissions on gfx_ring[0] and gfx_ring[1] will race on engine 0, risking
stale GPU TLB entries or wait timeouts and GPU hangs.
Checking ring->no_scheduler (or scoping the skip to GFX 13) would preserve
dedicated invalidation engines on earlier ASICs.
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
> index c06fa6b9b2991..f0ac919a43480 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
> @@ -990,10 +990,13 @@ static int gfx_v13_0_gfx_ring_init(struct amdgpu_device *adev, int ring_id,
> ring->ring_obj = NULL;
> ring->use_doorbell = true;
>
> - if (!ring_id)
> + if (!ring_id) {
> ring->doorbell_index = adev->doorbell_index.gfx_ring0 << 1;
> - else
> + } else {
> ring->doorbell_index = adev->doorbell_index.gfx_ring1 << 1;
> + ring->no_scheduler = true;
> + }
[Severity: Medium]
Can debugfs still re-enable gfx_ring[1] when only no_scheduler is set?
With adev->gfx.num_gfx_rings still at 2, amdgpu_debugfs_gfx_sched_mask_set()
flips ring->sched.ready back to true without checking ring->no_scheduler.
Because ring->no_user_submission is still false, amdgpu_hw_ip_info() then
counts gfx_ring[1] as a usable user ring and amdgpu_ib_ring_tests() tests it.
Keeping num_gfx_rings at 2 also still allocates, maps, and ring-tests pipe 1
in gfx_v13_0_cp_resume(), so a pipe 1 test failure still aborts hw_init.
Setting ring->no_user_submission = true and checking ring->no_scheduler in
amdgpu_debugfs_gfx_sched_mask_set() (or setting num_gfx_rings to 1 if
firmware does not require pipe 1 to be mapped) would avoid this.
[ ... ]
> @@ -3658,6 +3661,8 @@ static int gfx_v13_0_hw_init(struct amdgpu_ip_block *ip_block)
> if (r)
> return r;
>
> + adev->gfx.gfx_ring[1].sched.ready = false;
> +
> return r;
> }
[Severity: Medium]
Will an error in gfx_v13_0_cp_resume() leave gfx_ring[1].sched.ready set to
true?
gfx_v13_0_cp_resume() calls amdgpu_ring_test_helper() on gfx_ring[1], which
sets ring->sched.ready = true before testing the compute rings. If a
compute ring test fails, gfx_v13_0_hw_init() returns early before clearing
sched.ready, leaving the unscheduled ring marked ready.
Even when all ring tests succeed during resume or GPU reset, sched.ready is
transiently true while the compute ring tests run. Using
amdgpu_ring_test_ring() instead of amdgpu_ring_test_helper() when
ring->no_scheduler is set would avoid publishing sched.ready at all.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204142408.988734-1-Frank.Min@amd.com?part=2
next prev parent reply other threads:[~2026-12-04 14:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 14:24 [PATCH 1/9] drm/amdgpu: skip vm inv for kiq ring Frank Min
2026-12-04 14:24 ` [PATCH 2/9] drm/amdgpu: disable gfx 13 pipe 1 ring Frank Min
2026-12-04 14:55 ` sashiko-bot [this message]
2026-12-04 16:05 ` Alex Deucher
2026-12-04 14:24 ` [PATCH 3/9] drm/amdgpu: update table info retrieval from discovery binary Frank Min
2026-12-04 15:14 ` sashiko-bot
2026-12-04 16:19 ` Alex Deucher
2026-12-04 14:24 ` [PATCH 4/9] drm/amdgpu: add lsdma v8 fw query interface Frank Min
2026-12-04 15:25 ` sashiko-bot
2026-12-04 16:21 ` Alex Deucher
2026-12-04 14:24 ` [PATCH 5/9] drm/amdgpu: add lsdma v8 fw loading support Frank Min
2026-12-04 15:47 ` sashiko-bot
2026-12-04 14:24 ` [PATCH 6/9] drm/amdgpu: Fix system aperture size for gfx13 Frank Min
2026-12-04 16:01 ` sashiko-bot
2026-12-04 14:24 ` [PATCH 7/9] drm/amdgpu: remove the unused ring parameter in update_spm_vmid() " Frank Min
2026-12-04 16:03 ` Alex Deucher
2026-12-04 16:11 ` sashiko-bot
2026-12-04 14:24 ` [PATCH 8/9] drm/amdgpu: enable uni-mes " Frank Min
2026-12-04 16:41 ` sashiko-bot
2026-12-04 17:24 ` Alex Deucher
2026-12-04 14:24 ` [PATCH 9/9] drm/amdgpu: fix mutex unlock position for ucode loading Frank Min
2026-12-04 16:12 ` Alex Deucher
2026-12-04 16:52 ` sashiko-bot
2026-12-04 14:41 ` [PATCH 1/9] drm/amdgpu: skip vm inv for kiq ring sashiko-bot
2026-12-04 16:16 ` Alex Deucher
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-250030@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Min@amd.com \
--cc=amd-gfx@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.