]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 19 Nov 2024 20:23:18 +0000 (21:23 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Dec 2024 15:26:47 +0000 (10:26 -0500)
In case of error after a amdgpu_gfx_rlc_enter_safe_mode() call, it is not
balanced by a corresponding amdgpu_gfx_rlc_exit_safe_mode() call.

Add the missing call.

Fixes: 9b7b8154cdb8 ("drm/amd/powerplay: added didt support for vega10")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c

index 3007b054c873c9f4e68248e59463413247170af0..776d58ea63ae90002d85ffed60afd8dee399d50f 100644 (file)
@@ -1120,13 +1120,14 @@ static int vega10_enable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr)
        result = vega10_program_didt_config_registers(hwmgr, SEEDCForceStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT);
        result |= vega10_program_didt_config_registers(hwmgr, SEEDCCtrlForceStallConfig_Vega10, VEGA10_CONFIGREG_DIDT);
        if (0 != result)
-               return result;
+               goto exit_safe_mode;
 
        vega10_didt_set_mask(hwmgr, false);
 
+exit_safe_mode:
        amdgpu_gfx_rlc_exit_safe_mode(adev, 0);
 
-       return 0;
+       return result;
 }
 
 static int vega10_disable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr)