drm/amdgpu: fix kernel panic when dpm disabled on Kv.

Return early if it's disabled.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Rex Zhu 2017-01-20 14:30:51 +08:00 committed by Alex Deucher
parent 36a94a8ad7
commit 8485b5e187
1 changed files with 3 additions and 0 deletions

View File

@ -3079,6 +3079,9 @@ static int kv_dpm_hw_init(void *handle)
int ret;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (!amdgpu_dpm)
return 0;
mutex_lock(&adev->pm.mutex);
kv_dpm_setup_asic(adev);
ret = kv_dpm_enable(adev);