Commit cf8b92a7 authored by Roman Li's avatar Roman Li Committed by Alex Deucher

drm/amd/display: fix potential gpu reset deadlock

[Why]
In gpu reset dc_lock acquired in dm_suspend().
Asynchronously handle_hpd_rx_irq can also be called
through amdgpu_dm_irq_suspend->flush_work, which also
tries to acquire dc_lock. That causes a deadlock.

[How]
Check if amdgpu executing reset before acquiring dc_lock.
Signed-off-by: default avatarLang Yu <Lang.Yu@amd.com>
Signed-off-by: default avatarRoman Li <Roman.Li@amd.com>
Reviewed-by: default avatarQingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: default avatarWayne Lin <Wayne.Lin@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2e4ec251
...@@ -2726,12 +2726,14 @@ static void handle_hpd_rx_irq(void *param) ...@@ -2726,12 +2726,14 @@ static void handle_hpd_rx_irq(void *param)
} }
} }
if (!amdgpu_in_reset(adev))
mutex_lock(&adev->dm.dc_lock); mutex_lock(&adev->dm.dc_lock);
#ifdef CONFIG_DRM_AMD_DC_HDCP #ifdef CONFIG_DRM_AMD_DC_HDCP
result = dc_link_handle_hpd_rx_irq(dc_link, &hpd_irq_data, NULL); result = dc_link_handle_hpd_rx_irq(dc_link, &hpd_irq_data, NULL);
#else #else
result = dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL); result = dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL);
#endif #endif
if (!amdgpu_in_reset(adev))
mutex_unlock(&adev->dm.dc_lock); mutex_unlock(&adev->dm.dc_lock);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment