From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59AD9606A6A4 for ; Fri, 4 Dec 2026 14:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KAfD2Wzc Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED68811300C; Fri, 4 Dec 2026 14:56:00 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 13F7F113009 for ; Fri, 4 Dec 2026 14:55:54 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id F0BD543DA0; Fri, 4 Dec 2026 14:55:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 763EF1F00937; Fri, 4 Dec 2026 14:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796396153; bh=VNyh39rK5cY3rogf0vHVLwrdZIawktxmkro6EX3htZs=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=KAfD2WzcUjxO0x64W4YJXZoSZOzb1ceRB7uZnnxb5gN0qpSMSEPnVSysCvvvDYs1Z +m364EkBKDtyKZLp+slS+Rlhgam1UamyZ9ndu38YpZEOAWbj+f3eM6xCQJKn9ypmO1 PQtgBfNqd/oUIr/6zm3/Gjgux7Ddx4sOIKbDaOo0N3HiA8qAMRC9T0TUkmKFwwlsEQ pWwRrbUII9T+3vc6N+T8ou+bXPg6vSX3V3NUstuP5N2ymn99BCw+mCVRzr/z9pOShH nB/mfu3Gb7KDZbJ9UdJ69kWezW6kGOqU3GhyuQEIikmRaMvEQzl0+hD+D5vIKM75XV trT2ovuv1n0eQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/9] drm/amdgpu: disable gfx 13 pipe 1 ring To: "Frank Min" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261204142408.988734-2-Frank.Min@amd.com> References: <20261204142408.988734-1-Frank.Min@amd.com> <20261204142408.988734-2-Frank.Min@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 14:55:53 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "amd-gfx" X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 > drm/amdgpu: disable gfx 13 pipe 1 ring > > Disable gfx13 pipe 1 ring usage from the driver. > > Signed-off-by: Frank Min > Reviewed-by: Hawking Zhang [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/am= d/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_devi= ce *adev) > ring =3D=3D &adev->mes.ring[1] || > ring =3D=3D &adev->umsch_mm.ring || > ring =3D=3D &adev->cper.ring_buf || > - ring =3D=3D &adev->gfx.kiq[0].ring) > + ring =3D=3D &adev->gfx.kiq[0].ring || > + ring =3D=3D &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_de= vice *adev, int ring_id, > ring->ring_obj =3D NULL; > ring->use_doorbell =3D true; > =20 > - if (!ring_id) > + if (!ring_id) { > ring->doorbell_index =3D adev->doorbell_index.gfx_ring0 << 1; > - else > + } else { > ring->doorbell_index =3D adev->doorbell_index.gfx_ring1 << 1; > + ring->no_scheduler =3D 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 i= t. 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 =3D 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; > =20 > + adev->gfx.gfx_ring[1].sched.ready =3D 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 =3D 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204142408.9887= 34-1-Frank.Min@amd.com?part=3D2