Skip to content

Commit 5bd8e05

Browse files
yifancomalexdeucher
authored andcommitted
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: 710d9ca ("drm/amd/pm: drop most smu_cmn_get_smc_version in smu") Signed-off-by: Yifan Zhang <[email protected]> Reviewed-by: Candice Li <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2cea7bb commit 5bd8e05

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,12 +2461,18 @@ static bool sienna_cichlid_is_mode1_reset_supported(struct smu_context *smu)
24612461
{
24622462
struct amdgpu_device *adev = smu->adev;
24632463
uint32_t val;
2464+
uint32_t smu_version;
2465+
int ret;
24642466

24652467
/**
24662468
* SRIOV env will not support SMU mode1 reset
24672469
* PM FW support mode1 reset from 58.26
24682470
*/
2469-
if (amdgpu_sriov_vf(adev) || (smu->smc_fw_version < 0x003a1a00))
2471+
ret = smu_cmn_get_smc_version(smu, NULL, &smu_version);
2472+
if (ret)
2473+
return false;
2474+
2475+
if (amdgpu_sriov_vf(adev) || (smu_version < 0x003a1a00))
24702476
return false;
24712477

24722478
/**

drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,11 +1931,19 @@ static bool aldebaran_is_mode1_reset_supported(struct smu_context *smu)
19311931
#if 0
19321932
struct amdgpu_device *adev = smu->adev;
19331933
uint32_t val;
1934+
uint32_t smu_version;
1935+
int ret;
1936+
19341937
/**
19351938
* PM FW version support mode1 reset from 68.07
19361939
*/
1937-
if ((smu->smc_fw_version < 0x00440700))
1940+
ret = smu_cmn_get_smc_version(smu, NULL, &smu_version);
1941+
if (ret)
19381942
return false;
1943+
1944+
if ((smu_version < 0x00440700))
1945+
return false;
1946+
19391947
/**
19401948
* mode1 reset relies on PSP, so we should check if
19411949
* PSP is alive.

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2615,13 +2615,19 @@ static int smu_v13_0_0_baco_exit(struct smu_context *smu)
26152615
static bool smu_v13_0_0_is_mode1_reset_supported(struct smu_context *smu)
26162616
{
26172617
struct amdgpu_device *adev = smu->adev;
2618+
u32 smu_version;
2619+
int ret;
26182620

26192621
/* SRIOV does not support SMU mode1 reset */
26202622
if (amdgpu_sriov_vf(adev))
26212623
return false;
26222624

26232625
/* PMFW support is available since 78.41 */
2624-
if (smu->smc_fw_version < 0x004e2900)
2626+
ret = smu_cmn_get_smc_version(smu, NULL, &smu_version);
2627+
if (ret)
2628+
return false;
2629+
2630+
if (smu_version < 0x004e2900)
26252631
return false;
26262632

26272633
return true;

0 commit comments

Comments
 (0)