Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/pm: disable cstate feature for gpu reset scenario

Suggested by PMFW team and same as what did for gfxoff feature.
This can address some Mode1Reset failures observed on SMU13.0.0.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.0.x
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Evan Quan and committed by
Alex Deucher
3059cd8c ba2f0996

+25
+8
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 2928 2928 amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); 2929 2929 amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); 2930 2930 2931 + /* 2932 + * Per PMFW team's suggestion, driver needs to handle gfxoff 2933 + * and df cstate features disablement for gpu reset(e.g. Mode1Reset) 2934 + * scenario. Add the missing df cstate disablement here. 2935 + */ 2936 + if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW)) 2937 + dev_warn(adev->dev, "Failed to disallow df cstate"); 2938 + 2931 2939 for (i = adev->num_ip_blocks - 1; i >= 0; i--) { 2932 2940 if (!adev->ip_blocks[i].status.valid) 2933 2941 continue;
+8
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
··· 2242 2242 static int arcturus_set_df_cstate(struct smu_context *smu, 2243 2243 enum pp_df_cstate state) 2244 2244 { 2245 + struct amdgpu_device *adev = smu->adev; 2245 2246 uint32_t smu_version; 2246 2247 int ret; 2248 + 2249 + /* 2250 + * Arcturus does not need the cstate disablement 2251 + * prerequisite for gpu reset. 2252 + */ 2253 + if (amdgpu_in_reset(adev) || adev->in_suspend) 2254 + return 0; 2247 2255 2248 2256 ret = smu_cmn_get_smc_version(smu, NULL, &smu_version); 2249 2257 if (ret) {
+9
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
··· 1640 1640 static int aldebaran_set_df_cstate(struct smu_context *smu, 1641 1641 enum pp_df_cstate state) 1642 1642 { 1643 + struct amdgpu_device *adev = smu->adev; 1644 + 1645 + /* 1646 + * Aldebaran does not need the cstate disablement 1647 + * prerequisite for gpu reset. 1648 + */ 1649 + if (amdgpu_in_reset(adev) || adev->in_suspend) 1650 + return 0; 1651 + 1643 1652 return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_DFCstateControl, state, NULL); 1644 1653 } 1645 1654