From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
Qingqing Zhuo <Qingqing.Zhuo@amd.com>,
Roman Li <Roman.Li@amd.com>,
amd-gfx@lists.freedesktop.org,
Daniel Wheeler <daniel.wheeler@amd.com>,
dri-devel@lists.freedesktop.org, Wayne Lin <Wayne.Lin@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Lang Yu <Lang.Yu@amd.com>
Subject: [PATCH AUTOSEL 5.12 011/160] drm/amd/display: fix potential gpu reset deadlock
Date: Tue, 6 Jul 2021 07:15:57 -0400 [thread overview]
Message-ID: <20210706111827.2060499-11-sashal@kernel.org> (raw)
In-Reply-To: <20210706111827.2060499-1-sashal@kernel.org>
From: Roman Li <Roman.Li@amd.com>
[ 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>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
1 file changed, 4 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 eed494630583..d95569e0e53a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2624,13 +2624,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) {
--
2.30.2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2021-07-06 11:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210706111827.2060499-1-sashal@kernel.org>
2021-07-06 11:15 ` [PATCH AUTOSEL 5.12 005/160] drm/amd/display: fix HDCP reset sequence on reinitialize Sasha Levin
2021-07-06 11:15 ` [PATCH AUTOSEL 5.12 006/160] drm/amd/amdgpu/sriov disable all ip hw status by default Sasha Levin
2021-07-06 11:15 ` Sasha Levin [this message]
2021-07-06 11:15 ` [PATCH AUTOSEL 5.12 012/160] drm/amdgpu: change the default timeout for kernel compute queues Sasha Levin
2021-07-06 11:15 ` [PATCH AUTOSEL 5.12 013/160] drm/amd/display: fix use_max_lb flag for 420 pixel formats Sasha Levin
2021-07-06 11:16 ` [PATCH AUTOSEL 5.12 041/160] drm/amd/display: fix odm scaling Sasha Levin
2021-07-06 11:16 ` [PATCH AUTOSEL 5.12 055/160] drm/amdgpu: fix sdma firmware version error in sriov Sasha Levin
2021-07-06 11:16 ` [PATCH AUTOSEL 5.12 056/160] drm/amd/display: Avoid HDCP over-read and corruption Sasha Levin
2021-07-06 11:16 ` [PATCH AUTOSEL 5.12 057/160] drm/amdgpu: remove unsafe optimization to drop preamble ib Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 075/160] drm/amd/display: Fix DCN 3.01 DSCCLK validation Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 076/160] drm/amd/display: Update scaling settings on modeset Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 077/160] drm/amd/display: Release MST resources on switch from MST to SST Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 078/160] drm/amd/display: Set DISPCLK_MAX_ERRDET_CYCLES to 7 Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 079/160] drm/amd/display: Fix off-by-one error in DML Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 080/160] drm/amd/display: Fix crash during MPO + ODM combine mode recalculation Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 084/160] drm/amdkfd: use allowed domain for vmbo validation Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 088/160] drm/amd/display: Verify Gamma & Degamma LUT sizes in amdgpu_dm_atomic_check Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 095/160] drm/amdkfd: fix circular locking on get_wave_state Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 096/160] drm/amdkfd: Fix circular lock in nocpsch path Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 107/160] drm/amdgpu: fix bad address translation for sienna_cichlid Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 108/160] drm/amdkfd: Walk through list with dqm lock hold Sasha Levin
2021-07-06 11:17 ` [PATCH AUTOSEL 5.12 119/160] drm/amd/display: Fix edp_bootup_bl_level initialization issue Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210706111827.2060499-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Lang.Yu@amd.com \
--cc=Qingqing.Zhuo@amd.com \
--cc=Roman.Li@amd.com \
--cc=Wayne.Lin@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel.wheeler@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox