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 C730C606A32C for ; Fri, 4 Dec 2026 16:11:19 +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=WNpZv144 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68C49113103; Fri, 4 Dec 2026 16:11:14 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id E7A5B113103 for ; Fri, 4 Dec 2026 16:11:07 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id E7E0962F36; Fri, 4 Dec 2026 16:11:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 919741F000C2; Fri, 4 Dec 2026 16:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796400666; bh=zgfOY9clk3XmQceIWqNjK4uJVMed5f3ZmZLiX42pnnQ=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=WNpZv144H+GkjKRsGPxQQdKhEJW3A2rSWx0EnrPpbvKzRgNmMyphGEkEllx7UPf9l aqvQN1drC0QC4TeucyRo7GLtJS1Erfmuj3stPTmiy5DwIrhtm4/YSNPcFt0nMhryGm EznkyfVRzvJE81oz/FFs/uFVaElnXIusWyYVVIWKpGU5CI6+/20tLOEUxVDmAfNTjX xQgZzyXbfS+/h8x1Ai7IwpQtHWVO/25HlvuN5/xLrJHaCTs9og0rX5U0nEtN1qwI6s zcSoe3+kKPsT/AEuuRlk/qReiO5EmZLcx7xUUaItBqtYNlBAS4BSaj9p8t4OYrj6zl F7iCEFVmsNdhA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 7/9] drm/amdgpu: remove the unused ring parameter in update_spm_vmid() for gfx13 To: "Frank Min" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261204142408.988734-7-Frank.Min@amd.com> References: <20261204142408.988734-1-Frank.Min@amd.com> <20261204142408.988734-7-Frank.Min@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 16:11:06 +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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 2 potential issues to consider: - [High] drm/amdgpu: update_spm_vmid() signature mismatch breaks gfx_v13_0.c build - [High] drm/amdgpu: dropping ring path in gfx_v13_0_update_spm_vmid() breaks IB SPM -- commit a118ecae2dc4a26b43bad4e4bf47f778ad08d52a Author: Frank Min drm/amdgpu: remove the unused ring parameter in update_spm_vmid() for gfx13 This patch removes the ring parameter and its in-band ring write path from gfx_v13_0_update_spm_vmid(), and updates its call site in gfx_v13_0_rlc_resume() accordingly. > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c b/drivers/gpu/drm/amd= /amdgpu/gfx_v13_0.c > index f0ac919a43480..9ef249b95f916 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c > @@ -2134,7 +2134,7 @@ static int gfx_v13_0_rlc_resume(struct amdgpu_devic= e *adev) > =20 > /* init spm vmid with 0xf */ > if (adev->gfx.rlc.funcs->update_spm_vmid) > - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, adev->vm_manager.s= pm_vmid); > + adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, adev->vm_manager.spm_vmi= d); [Severity: High] Does this break the build due to a signature mismatch with struct amdgpu_rlc_funcs? struct amdgpu_rlc_funcs in drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h still declares update_spm_vmid with four parameters, including struct amdgpu_ring *ring, as restored by e9ebb72a64b6 ("drm/amdgpu: bring back the ring parameter for update_spm_vmid()"). Calling update_spm_vmid() with three arguments here fails compilation, as does assigning the three-parameter gfx_v13_0_update_spm_vmid() to gfx_v13_0_rlc_funcs.update_spm_vmid. [ ... ] > @@ -3963,22 +3963,12 @@ static void gfx_v13_0_update_perf_clk(struct amdg= pu_device *adev, > =20 > static void gfx_v13_0_update_spm_vmid(struct amdgpu_device *adev, > int xcc_id, > - struct amdgpu_ring *ring, > unsigned vmid) > { > u32 reg, data; > =20 > reg =3D SOC15_REG_OFFSET(GC, 0, regRLC_SPM_MC_CNTL); > =20 > - if (ring) { > - if ((ring->funcs->type =3D=3D AMDGPU_RING_TYPE_GFX) || > - (ring->funcs->type =3D=3D AMDGPU_RING_TYPE_COMPUTE)) { > - data =3D (vmid & RLC_SPM_MC_CNTL__RLC_SPM_VMID_MASK) << RLC_SPM_MC_CN= TL__RLC_SPM_VMID__SHIFT; > - amdgpu_ring_emit_wreg(ring, reg, data); > - } > - return; > - } > - > amdgpu_gfx_off_ctrl(adev, false); > if (amdgpu_sriov_is_pp_one_vf(adev)) > data =3D RREG32_NO_KIQ(reg); [Severity: High] Is the ring parameter actually unused, and does deleting this branch break in-band SPM updates during IB submission? amdgpu_ib_schedule() still passes a non-NULL ring to update_spm_vmid() on every gfx and compute IB submission. Both gfx_v13_0_ring_funcs_gfx and gfx_v13_0_ring_funcs_compute also reserve 5 dwords in emit_frame_size for this write. Even if the signature were reconciled, dropping the if (ring) path loses the ring-based regRLC_SPM_MC_CNTL update across gfxoff cycles and forces every IB submission through amdgpu_gfx_off_ctrl() (acquiring adev->gfx.gfx_off_mutex) and unlocked CPU register read-modify-writes. Should this patch be dropped instead so gfx13 keeps the ring path? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204142408.9887= 34-1-Frank.Min@amd.com?part=3D7