diff options
| author | Stanley.Yang <[email protected]> | 2022-03-21 04:50:36 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2022-03-25 16:40:24 +0000 |
| commit | 93dde6ccd66d29502506e95f568fd0f49d575d27 (patch) | |
| tree | d12063548bea0c8f2325394104579f8ea8a52efc /drivers/gpu/drm/amd/pm/amdgpu_dpm.c | |
| parent | drm/amdgpu: add workarounds for VCN TMZ issue on CHIP_RAVEN (diff) | |
| download | kernel-93dde6ccd66d29502506e95f568fd0f49d575d27.tar.gz kernel-93dde6ccd66d29502506e95f568fd0f49d575d27.zip | |
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.
Signed-off-by: Stanley.Yang <[email protected]>
Reviewed-by: Evan Quan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_dpm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c index 89fbee568be4..c73fb73e9628 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c @@ -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); @@ -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); |
