[PATCH] drm/amd/display: Fix deadlock during gpu reset v2
Lakha, Bhawanpreet
Bhawanpreet.Lakha at amd.com
Tue Jan 12 16:06:56 UTC 2021
[AMD Public Use]
sorry, I misread your email, I will post a v3
Bhawan
________________________________
From: Lakha, Bhawanpreet <Bhawanpreet.Lakha at amd.com>
Sent: January 12, 2021 11:03 AM
To: Chen, Guchun <Guchun.Chen at amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>
Cc: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Subject: Re: [PATCH] drm/amd/display: Fix deadlock during gpu reset v2
No need since "dc_allow_idle_optimizations" will not do anything for asics below dcn3
Bhawan
________________________________
From: Chen, Guchun <Guchun.Chen at amd.com>
Sent: January 11, 2021 10:01 PM
To: Lakha, Bhawanpreet <Bhawanpreet.Lakha at amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>
Cc: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>; Lakha, Bhawanpreet <Bhawanpreet.Lakha at amd.com>
Subject: RE: [PATCH] drm/amd/display: Fix deadlock during gpu reset v2
[AMD Public Use]
When using dc_allow_idle_optimizations, should it be guarded by CONFIG_DRM_AMD_DC_DCN?
Regards,
Guchun
-----Original Message-----
From: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
Sent: Tuesday, January 12, 2021 5:03 AM
To: Kazlauskas, Nicholas <Nicholas.Kazlauskas at amd.com>; Chen, Guchun <Guchun.Chen at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>
Cc: amd-gfx at lists.freedesktop.org; Lakha, Bhawanpreet <Bhawanpreet.Lakha at amd.com>
Subject: [PATCH] drm/amd/display: Fix deadlock during gpu reset v2
[Why]
during idle optimizations we acquire the dc_lock, this lock is also acquired during gpu_reset so we end up hanging the system due to a deadlock
[How]
If we are in gpu reset:
- disable idle optimizations and skip calls to the dc function
v2: skip idle optimizations calls
Fixes: 06d5652541c3 ("drm/amd/display: enable idle optimizations for linux (MALL stutter)")
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 99c7f9eb44aa..858c6ff173ba 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1816,6 +1816,9 @@ static int dm_suspend(void *handle)
if (amdgpu_in_reset(adev)) {
mutex_lock(&dm->dc_lock);
+
+ dc_allow_idle_optimizations(adev->dm.dc, false);
+
dm->cached_dc_state = dc_copy_state(dm->dc->current_state);
dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false); @@ -5556,6 +5559,9 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))
return -EBUSY;
+ if (amdgpu_in_reset(adev))
+ return 0;
+
mutex_lock(&dm->dc_lock);
if (enable)
--
2.25.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210112/f503cfdb/attachment-0001.htm>
More information about the amd-gfx
mailing list