]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/amd/display: fix potential gpu reset deadlock
authorRoman Li <Roman.Li@amd.com>
Mon, 19 Apr 2021 15:47:00 +0000 (11:47 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:47 +0000 (09:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit cf8b92a75646735136053ce51107bfa8cfc23191 ]

[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: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Wayne Lin <Wayne.Lin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 35dd8f9f703e468bd96059820a334d5b9c9bdc24..3031f31415a1ab0e85ca38650e96bf10e6818e8b 100644 (file)
@@ -2557,13 +2557,15 @@ static void handle_hpd_rx_irq(void *param)
                }
        }
 
-       mutex_lock(&adev->dm.dc_lock);
+       if (!amdgpu_in_reset(adev))
+               mutex_lock(&adev->dm.dc_lock);
 #ifdef CONFIG_DRM_AMD_DC_HDCP
        result = dc_link_handle_hpd_rx_irq(dc_link, &hpd_irq_data, NULL);
 #else
        result = dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL);
 #endif
-       mutex_unlock(&adev->dm.dc_lock);
+       if (!amdgpu_in_reset(adev))
+               mutex_unlock(&adev->dm.dc_lock);
 
 out:
        if (result && !is_mst_root_connector) {