aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
diff options
context:
space:
mode:
authorKevin Wang <kevin1.wang@amd.com>2019-05-15 03:59:38 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-21 19:59:32 -0400
commit6f6a7bba696118ea440116f7c09dc93e18d8e78b (patch)
tree88d0109efc7ba135dfecf9529ccd3ab04c6f0c8e /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
parent3ebab625e6626a0794808a25ea2de5de1ea65646 (diff)
drm/amd/powerplay: fix deadlock issue for smu_force_performance_level
the smu->mutex is internal lock resource in sw-smu, some functions will use it at the same time, so it maybe will cause deadlock issue. this patch fix this issue in smu_force_performance_level function. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index d78d9cbd0ee9..2f4b03b4e882 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -370,18 +370,9 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
370 } 370 }
371 371
372 if (is_support_sw_smu(adev)) { 372 if (is_support_sw_smu(adev)) {
373 mutex_lock(&adev->pm.mutex);
374 if (adev->pm.dpm.thermal_active) {
375 count = -EINVAL;
376 mutex_unlock(&adev->pm.mutex);
377 goto fail;
378 }
379 ret = smu_force_performance_level(&adev->smu, level); 373 ret = smu_force_performance_level(&adev->smu, level);
380 if (ret) 374 if (ret)
381 count = -EINVAL; 375 count = -EINVAL;
382 else
383 adev->pm.dpm.forced_level = level;
384 mutex_unlock(&adev->pm.mutex);
385 } else if (adev->powerplay.pp_funcs->force_performance_level) { 376 } else if (adev->powerplay.pp_funcs->force_performance_level) {
386 mutex_lock(&adev->pm.mutex); 377 mutex_lock(&adev->pm.mutex);
387 if (adev->pm.dpm.thermal_active) { 378 if (adev->pm.dpm.thermal_active) {