OSDN Git Service

drm/amdgpu: skip unload tmr when tmr is not loaded
authorTong Liu01 <Tong.Liu01@amd.com>
Tue, 21 Mar 2023 09:10:04 +0000 (17:10 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Mar 2023 22:20:14 +0000 (18:20 -0400)
[why]
Skip TMR unload for Navi12 and CHIP_SIENNA_CICHLID SRIOV as TMR is
not loaded at all

Signed-off-by: Tong Liu01 <Tong.Liu01@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 0b9e99c..9d7e6e0 100644 (file)
@@ -839,7 +839,15 @@ static void psp_prep_tmr_unload_cmd_buf(struct psp_context *psp,
 static int psp_tmr_unload(struct psp_context *psp)
 {
        int ret;
-       struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp);
+       struct psp_gfx_cmd_resp *cmd;
+
+       /* skip TMR unload for Navi12 and CHIP_SIENNA_CICHLID SRIOV,
+        * as TMR is not loaded at all
+        */
+       if (amdgpu_sriov_vf(psp->adev) && psp_skip_tmr(psp))
+               return 0;
+
+       cmd = acquire_psp_cmd_buf(psp);
 
        psp_prep_tmr_unload_cmd_buf(psp, cmd);
        dev_dbg(psp->adev->dev, "free PSP TMR buffer\n");