summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
diff options
context:
space:
mode:
authorYifan Zhang <yifan1.zhang@amd.com>2023-10-24 21:16:26 +0800
committerAlex Deucher <alexander.deucher@amd.com>2023-10-26 19:02:58 -0400
commit5bd8e05fe203aa33721cf301a6883b28493f73ab (patch)
tree5e23547fa24311e38f66f245faa64e8142f402e4 /drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
parent2cea7bb9110d3c52e55977824f79875777b574b4 (diff)
drm/amd/pm: call smu_cmn_get_smc_version in is_mode1_reset_supported.
is_mode1_reset_supported may be called before smu init, when smu_context is unitialized in driver load/unload test. Call smu_cmn_get_smc_version explicitly in is_mode1_reset_supported. v2: apply to aldebaran in case is_mode1_reset_supported will be uncommented (Candice Li) Fixes: 710d9caec70c ("drm/amd/pm: drop most smu_cmn_get_smc_version in smu") Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com> Reviewed-by: Candice Li <candice.li@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
index f082cd4b40c1..1a6675d70a4b 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
@@ -1931,11 +1931,19 @@ static bool aldebaran_is_mode1_reset_supported(struct smu_context *smu)
#if 0
struct amdgpu_device *adev = smu->adev;
uint32_t val;
+ uint32_t smu_version;
+ int ret;
+
/**
* PM FW version support mode1 reset from 68.07
*/
- if ((smu->smc_fw_version < 0x00440700))
+ ret = smu_cmn_get_smc_version(smu, NULL, &smu_version);
+ if (ret)
return false;
+
+ if ((smu_version < 0x00440700))
+ return false;
+
/**
* mode1 reset relies on PSP, so we should check if
* PSP is alive.