diff options
author | Sonny Jiang <sonny.jiang@amd.com> | 2015-04-30 17:12:14 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-03 21:03:24 -0400 |
commit | 46651cc5dbee35dd2f25a02de328d3e7310ce64b (patch) | |
tree | 4d86c7d4d5eba2301af73243be56be4d0aae4b2c /drivers/gpu | |
parent | c92b90ccc20bb55a3a0bb8fcc55c18d0710f8cb7 (diff) |
drm/amdgpu fix amdgpu.dpm=0 (v2)
Fix crash when disabling dpm.
v2: agd5f: fix coding style, cleanup commit message
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c index e56f54bf87d2..adf4dbc3f6a0 100644 --- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c @@ -1206,10 +1206,7 @@ static int cz_dpm_enable(struct amdgpu_device *adev) static int cz_dpm_hw_init(struct amdgpu_device *adev) { - int ret; - - if (!amdgpu_dpm) - return 0; + int ret = 0; mutex_lock(&adev->pm.mutex); @@ -1229,6 +1226,12 @@ static int cz_dpm_hw_init(struct amdgpu_device *adev) return ret; } + if (!amdgpu_dpm) { + adev->pm.dpm_enabled = false; + mutex_unlock(&adev->pm.mutex); + return ret; + } + /* cz dpm setup asic */ cz_dpm_setup_asic(adev); @@ -1326,6 +1329,12 @@ static int cz_dpm_resume(struct amdgpu_device *adev) return ret; } + if (!amdgpu_dpm) { + adev->pm.dpm_enabled = false; + mutex_unlock(&adev->pm.mutex); + return ret; + } + /* cz dpm setup asic */ cz_dpm_setup_asic(adev); |