Skip to content

Commit 7d51a8a

Browse files
Stanley.YangStanley.Yang
authored andcommitted
drm/amdgpu/pm: add asic smu support check
It must check asic whether support smu before call smu powerplay function, otherwise it may cause null point on no support smu asic. Change-Id: Ib86f3d4c88317b23eb1040b9ce1c5c8dcae42488 Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com>
1 parent 2dd6a04 commit 7d51a8a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/amd/pm/amdgpu_dpm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ int amdgpu_dpm_send_hbm_bad_pages_num(struct amdgpu_device *adev, uint32_t size)
500500
struct smu_context *smu = adev->powerplay.pp_handle;
501501
int ret = 0;
502502

503+
if (!is_support_sw_smu(adev))
504+
return -EOPNOTSUPP;
505+
503506
mutex_lock(&adev->pm.mutex);
504507
ret = smu_send_hbm_bad_pages_num(smu, size);
505508
mutex_unlock(&adev->pm.mutex);
@@ -512,6 +515,9 @@ int amdgpu_dpm_send_hbm_bad_channel_flag(struct amdgpu_device *adev, uint32_t si
512515
struct smu_context *smu = adev->powerplay.pp_handle;
513516
int ret = 0;
514517

518+
if (!is_support_sw_smu(adev))
519+
return -EOPNOTSUPP;
520+
515521
mutex_lock(&adev->pm.mutex);
516522
ret = smu_send_hbm_bad_channel_flag(smu, size);
517523
mutex_unlock(&adev->pm.mutex);

0 commit comments

Comments
 (0)