Skip to contentSkip to conversation

drm/amd/powerplay: fix deadlock around smu_handle_task V2

PATCH In review Evan Quan 3 participants 4 messages Jul 12, 2019 – Jul 16, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: fix deadlock around smu_handle_task V2

As the lock was already held on the entrance to smu_handle_task.

- V2: lock in small granularity

Change-Id I5388aa917ef0e330974e26c59db42d1354b6a865
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -2
index 961f4e54ed18..eb255a6bd3a9 100644
@@ -3049,11 +3049,9 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
 	if (is_support_sw_smu(adev)) {
 		struct smu_context *smu = &adev->smu;
 		struct smu_dpm_context *smu_dpm = &adev->smu.smu_dpm;
-		mutex_lock(&(smu->mutex));
 		smu_handle_task(&adev->smu,
 				smu_dpm->dpm_level,
 				AMD_PP_TASK_DISPLAY_CONFIG_CHANGE);
-		mutex_unlock(&(smu->mutex));
 	} else {
 		if (adev->powerplay.pp_funcs->dispatch_tasks) {
 			if (!amdgpu_device_has_dc_support(adev)) {
Signature · 6 lines
2.21.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#2 lore raw

Ping..

Quoted 39 lines

-----Original Message-----
From: Evan Quan <[email protected]>
Sent: Friday, July 12, 2019 1:51 PM
To: [email protected]
Cc: Wang, Kevin(Yang) <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix deadlock around smu_handle_task V2

As the lock was already held on the entrance to smu_handle_task.

- V2: lock in small granularity

Change-Id I5388aa917ef0e330974e26c59db42d1354b6a865
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -2
index 961f4e54ed18..eb255a6bd3a9 100644
@@ -3049,11 +3049,9 @@ void amdgpu_pm_compute_clocks(struct
 amdgpu_device *adev)
 	if (is_support_sw_smu(adev)) {
 		struct smu_context *smu = &adev->smu;
 		struct smu_dpm_context *smu_dpm = &adev-
 >smu.smu_dpm;
-		mutex_lock(&(smu->mutex));
 		smu_handle_task(&adev->smu,
 				smu_dpm->dpm_level,
 				AMD_PP_TASK_DISPLAY_CONFIG_CHANGE);
-		mutex_unlock(&(smu->mutex));
 	} else {
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -1
 		if (adev->powerplay.pp_funcs->dispatch_tasks) {
 			if (!amdgpu_device_has_dc_support(adev)) {
--
Quoted 1 line

2.21.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): MN2PR12MB3344074D151A9DF09836BFEDE4CE0-rweVpJHSKToDMgCC8P//[email protected]

Reviewed-by
#4 lore raw

Best Regards,

Kevin

________________________________
From: Quan, Evan
Sent: Tuesday, July 16, 2019 11:01:43 AM
To: Quan, Evan; [email protected]
Cc: Wang, Kevin(Yang)
Subject: RE: [PATCH] drm/amd/powerplay: fix deadlock around smu_handle_task V2

Ping..

Quoted 38 lines

-----Original Message-----
From: Evan Quan <[email protected]>
Sent: Friday, July 12, 2019 1:51 PM
To: [email protected]
Cc: Wang, Kevin(Yang) <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix deadlock around smu_handle_task V2

As the lock was already held on the entrance to smu_handle_task.

- V2: lock in small granularity

Change-Id I5388aa917ef0e330974e26c59db42d1354b6a865
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -2
index 961f4e54ed18..eb255a6bd3a9 100644
@@ -3049,11 +3049,9 @@ void amdgpu_pm_compute_clocks(struct
 amdgpu_device *adev)
       if (is_support_sw_smu(adev)) {
               struct smu_context *smu = &adev->smu;
               struct smu_dpm_context *smu_dpm = &adev-
 >smu.smu_dpm;
-             mutex_lock(&(smu->mutex));
               smu_handle_task(&adev->smu,
                               smu_dpm->dpm_level,
                               AMD_PP_TASK_DISPLAY_CONFIG_CHANGE);
-             mutex_unlock(&(smu->mutex));
       } else {
               if (adev->powerplay.pp_funcs->dispatch_tasks) {
                       if (!amdgpu_device_has_dc_support(adev)) {
Quoted 2 lines

--
2.21.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#5 lore raw
In reply to a message not in the archive

Best Regards,
Kevin

Quoted 32 lines · Evan

Ping..

Quoted 30 lines

-----Original Message-----
From: Evan Quan <[email protected]>
Sent: Friday, July 12, 2019 1:51 PM
To: [email protected]
Cc: Wang, Kevin(Yang) <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix deadlock around smu_handle_task V2

As the lock was already held on the entrance to smu_handle_task.

- V2: lock in small granularity

Change-Id I5388aa917ef0e330974e26c59db42d1354b6a865
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 --
  1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -0
index 961f4e54ed18..eb255a6bd3a9 100644
@@ -3049,11 +3049,9 @@ void amdgpu_pm_compute_clocks(struct
 amdgpu_device *adev)
  	if (is_support_sw_smu(adev)) {
  		struct smu_context *smu = &adev->smu;
  		struct smu_dpm_context *smu_dpm = &adev-
 > smu.smu_dpm;
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -2
-		mutex_lock(&(smu->mutex));
  		smu_handle_task(&adev->smu,
  				smu_dpm->dpm_level,
  				AMD_PP_TASK_DISPLAY_CONFIG_CHANGE);
-		mutex_unlock(&(smu->mutex));
  	} else {

if (adev->powerplay.pp_funcs->dispatch_tasks) {
if (!amdgpu_device_has_dc_support(adev)) {
--
2.21.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx