[PATCH 5.13 411/800] drm/amd/display: Avoid HPD IRQ in GPU reset state

From: Greg Kroah-Hartman
Date: Mon Jul 12 2021 - 04:34:34 EST


From: Zhan Liu <zhan.liu@xxxxxxx>

[ Upstream commit 509b9a5b4865dee723296f143695a7774fc96c4a ]

[Why]
If GPU is in reset state, force enabling link will cause
unexpected behaviour.

[How]
Avoid handling HPD IRQ when GPU is in reset state.

Signed-off-by: Zhan Liu <zhan.liu@xxxxxxx>
Reviewed-by: Nikola Cornij <nikola.cornij@xxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
1 file changed, 2 insertions(+), 2 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 875fd187463e..dcb4e585c270 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2726,15 +2726,15 @@ static void handle_hpd_rx_irq(void *param)
}
}

- if (!amdgpu_in_reset(adev))
+ 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
- if (!amdgpu_in_reset(adev))
mutex_unlock(&adev->dm.dc_lock);
+ }

out:
if (result && !is_mst_root_connector) {
--
2.30.2