Skip to content

Commit

Permalink
drm/amdgpu/pm: add asic smu support check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stanley.Yang authored and Stanley.Yang committed Mar 21, 2022
1 parent 2dd6a04 commit 7d51a8a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/pm/amdgpu_dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ int amdgpu_dpm_send_hbm_bad_pages_num(struct amdgpu_device *adev, uint32_t size)
struct smu_context *smu = adev->powerplay.pp_handle;
int ret = 0;

if (!is_support_sw_smu(adev))
return -EOPNOTSUPP;

mutex_lock(&adev->pm.mutex);
ret = smu_send_hbm_bad_pages_num(smu, size);
mutex_unlock(&adev->pm.mutex);
Expand All @@ -512,6 +515,9 @@ int amdgpu_dpm_send_hbm_bad_channel_flag(struct amdgpu_device *adev, uint32_t si
struct smu_context *smu = adev->powerplay.pp_handle;
int ret = 0;

if (!is_support_sw_smu(adev))
return -EOPNOTSUPP;

mutex_lock(&adev->pm.mutex);
ret = smu_send_hbm_bad_channel_flag(smu, size);
mutex_unlock(&adev->pm.mutex);
Expand Down

0 comments on commit 7d51a8a

Please sign in to comment.