Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] drm/amdgpu: gfx_v9_4_3_xcc_rlc_resume() passes 0 instead of xcc_id - [Medium] drm/amdgpu: moving update_spm_vmid() to gfx_v9_4_3_xcc_rlc_resume() skips VFs --
commit 754d99a96da547c9e401d40cfbeb309d0d3aa36f Author: Alex Deucher <[email protected]> drm/amdgpu/gfx9.4.3: program the RLC SPM in RLC resume This commit moves the RLC SPM VMID programming from gfx_v9_4_3_rlc_init() to gfx_v9_4_3_xcc_rlc_resume() so that the register is reprogrammed after suspend/resume and GPU reset. > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c > b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c > index da031caa4e9e6..151336e6094f7 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c > @@ -1395,10 +1395,6 @@ static void > gfx_v9_4_3_init_rlcg_reg_access_ctrl(struct amdgpu_device *adev) > > static int gfx_v9_4_3_rlc_init(struct amdgpu_device *adev) > { > - /* init spm vmid with 0xf */ > - if (adev->gfx.rlc.funcs->update_spm_vmid) > - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, > adev->vm_manager.spm_vmid); > - > return 0; > } > > @@ -1588,6 +1584,10 @@ static int gfx_v9_4_3_xcc_rlc_resume(struct > amdgpu_device *adev, int xcc_id) > gfx_v9_4_3_xcc_init_pg(adev, xcc_id); > amdgpu_gfx_rlc_exit_safe_mode(adev, xcc_id); > > + /* init spm vmid with 0xf */ > + if (adev->gfx.rlc.funcs->update_spm_vmid) > + adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, > adev->vm_manager.spm_vmid); > + > return 0; > } [Severity: High] Should update_spm_vmid() pass xcc_id instead of 0 here? gfx_v9_4_3_rlc_resume() and gfx_v9_4_3_xcp_resume() call gfx_v9_4_3_xcc_rlc_resume() for each XCC instance, and gfx_v9_4_3_update_spm_vmid() uses the instance argument with GET_INST(GC, inst) to select which XCC's regRLC_SPM_MC_CNTL register to write. Passing 0 programs XCC 0 on every iteration and leaves regRLC_SPM_MC_CNTL on all other XCCs at its hardware reset default of VMID 0. [Severity: Medium] Does moving update_spm_vmid() into gfx_v9_4_3_xcc_rlc_resume() skip SPM VMID initialization on SR-IOV VFs? Both callers of gfx_v9_4_3_xcc_rlc_resume() (gfx_v9_4_3_rlc_resume() and gfx_v9_4_3_xcp_resume()) skip calling it when amdgpu_sriov_vf(adev) is true: drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:gfx_v9_4_3_rlc_resume() { if (amdgpu_sriov_vf(adev)) return 0; num_xcc = NUM_XCC(adev->gfx.xcc_mask); for (i = 0; i < num_xcc; i++) { r = gfx_v9_4_3_xcc_rlc_resume(adev, i); ... } Unlike gfx_v9_4_3_rlc_init(), which ran during sw_init on VFs as well, gfx_v9_4_3_update_spm_vmid() is no longer reached on SR-IOV VFs, leaving regRLC_SPM_MC_CNTL unprogrammed in SR-IOV one-VF mode despite the amdgpu_sriov_is_pp_one_vf(adev) handling in gfx_v9_4_3_update_spm_vmid(). -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=4
