diff options
author | Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> | 2021-01-11 14:45:12 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-01-13 23:48:47 -0500 |
commit | 98ab5f3513f90f18365d488d02b57efbfbdf274f (patch) | |
tree | 6b8576bbcaa0c1143cd45a0aa56030c287193539 /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |
parent | 966737906ce063e5d7314aa12664970a1949eb02 (diff) | |
download | lwn-98ab5f3513f90f18365d488d02b57efbfbdf274f.tar.gz lwn-98ab5f3513f90f18365d488d02b57efbfbdf274f.zip |
drm/amd/display: Fix deadlock during gpu reset v3
[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
v3: add guard for DCN
Fixes: 71338cb4a7c2b51 ("drm/amd/display: enable idle optimizations for linux (MALL stutter)")
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 2dc8493793e0..d26296cfa06e 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,11 @@ static int dm_suspend(void *handle) if (amdgpu_in_reset(adev)) { mutex_lock(&dm->dc_lock); + +#if defined(CONFIG_DRM_AMD_DC_DCN) + dc_allow_idle_optimizations(adev->dm.dc, false); +#endif + dm->cached_dc_state = dc_copy_state(dm->dc->current_state); dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false); @@ -5483,6 +5488,10 @@ 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 defined(CONFIG_DRM_AMD_DC_DCN) + if (amdgpu_in_reset(adev)) + return 0; + mutex_lock(&dm->dc_lock); if (enable) @@ -5499,6 +5508,7 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable) mutex_unlock(&dm->dc_lock); +#endif return 0; } |