diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2017-01-20 01:30:51 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 12:20:44 -0500 |
commit | 8485b5e1876b46d7c4f63a2cfcec2ee30362a207 (patch) | |
tree | 4393ac8f7ab7cbbe2a971741ed026d5ff8497d9b | |
parent | 36a94a8ad74e83a135a4b0a2157dabe50b4562a6 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c index 6b6476dae970..8785ca570729 100644 --- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c | |||
@@ -3079,6 +3079,9 @@ static int kv_dpm_hw_init(void *handle) | |||
3079 | int ret; | 3079 | int ret; |
3080 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 3080 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
3081 | 3081 | ||
3082 | if (!amdgpu_dpm) | ||
3083 | return 0; | ||
3084 | |||
3082 | mutex_lock(&adev->pm.mutex); | 3085 | mutex_lock(&adev->pm.mutex); |
3083 | kv_dpm_setup_asic(adev); | 3086 | kv_dpm_setup_asic(adev); |
3084 | ret = kv_dpm_enable(adev); | 3087 | ret = kv_dpm_enable(adev); |