From: Lyude Paul <lyude@redhat.com>
To: amd-gfx@lists.freedesktop.org
Cc: "open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
"Leo Li" <sunpeng.li@amd.com>, "David Airlie" <airlied@gmail.com>,
"David Francis" <David.Francis@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Roman Li" <Roman.Li@amd.com>,
stable@vger.kernel.org,
"Nicholas Kazlauskas" <nicholas.kazlauskas@amd.com>,
"Wenjing Liu" <Wenjing.Liu@amd.com>,
"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
"hersen wu" <hersenxs.wu@amd.com>,
"Hamza Mahfooz" <hamza.mahfooz@amd.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Wayne Lin" <Wayne.Lin@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Mikita Lipski" <mikita.lipski@amd.com>,
"Harry Wentland" <harry.wentland@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 4/4] drm/amdgpu/dm/dp_mst: Don't grab mst_mgr->lock when computing DSC state
Date: Mon, 14 Nov 2022 17:17:55 -0500 [thread overview]
Message-ID: <20221114221754.385090-5-lyude@redhat.com> (raw)
In-Reply-To: <20221114221754.385090-1-lyude@redhat.com>
Now that we've fixed the issue with using the incorrect topology manager,
we're actually grabbing the topology manager's lock - and consequently
deadlocking. Luckily for us though, there's actually nothing in AMD's DSC
state computation code that really should need this lock. The one exception
is the mutex_lock() in dm_dp_mst_is_port_support_mode(), however we grab no
locks beneath &mgr->lock there so that should be fine to leave be.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Gitlab issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Fixes: 8c20a1ed9b4f ("drm/amd/display: MST DSC compute fair share")
Cc: <stable@vger.kernel.org> # v5.6+
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 5196c9a0e432d..59648f5ffb59d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -1148,10 +1148,8 @@ int compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
continue;
mst_mgr = aconnector->port->mgr;
- mutex_lock(&mst_mgr->lock);
ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
&link_vars_start_index);
- mutex_unlock(&mst_mgr->lock);
if (ret != 0)
return ret;
@@ -1208,10 +1206,8 @@ static int pre_compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
continue;
mst_mgr = aconnector->port->mgr;
- mutex_lock(&mst_mgr->lock);
ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
&link_vars_start_index);
- mutex_unlock(&mst_mgr->lock);
if (ret != 0)
return ret;
--
2.37.3
WARNING: multiple messages have this Message-ID (diff)
From: Lyude Paul <lyude@redhat.com>
To: amd-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org, "Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"hersen wu" <hersenxs.wu@amd.com>,
"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
"Wayne Lin" <Wayne.Lin@amd.com>,
"Nicholas Kazlauskas" <nicholas.kazlauskas@amd.com>,
"Roman Li" <Roman.Li@amd.com>,
"Hamza Mahfooz" <hamza.mahfooz@amd.com>,
"David Francis" <David.Francis@amd.com>,
"Wenjing Liu" <Wenjing.Liu@amd.com>,
"Mikita Lipski" <mikita.lipski@amd.com>,
dri-devel@lists.freedesktop.org (open list:DRM DRIVERS),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 4/4] drm/amdgpu/dm/dp_mst: Don't grab mst_mgr->lock when computing DSC state
Date: Mon, 14 Nov 2022 17:17:55 -0500 [thread overview]
Message-ID: <20221114221754.385090-5-lyude@redhat.com> (raw)
In-Reply-To: <20221114221754.385090-1-lyude@redhat.com>
Now that we've fixed the issue with using the incorrect topology manager,
we're actually grabbing the topology manager's lock - and consequently
deadlocking. Luckily for us though, there's actually nothing in AMD's DSC
state computation code that really should need this lock. The one exception
is the mutex_lock() in dm_dp_mst_is_port_support_mode(), however we grab no
locks beneath &mgr->lock there so that should be fine to leave be.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Gitlab issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Fixes: 8c20a1ed9b4f ("drm/amd/display: MST DSC compute fair share")
Cc: <stable@vger.kernel.org> # v5.6+
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 5196c9a0e432d..59648f5ffb59d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -1148,10 +1148,8 @@ int compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
continue;
mst_mgr = aconnector->port->mgr;
- mutex_lock(&mst_mgr->lock);
ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
&link_vars_start_index);
- mutex_unlock(&mst_mgr->lock);
if (ret != 0)
return ret;
@@ -1208,10 +1206,8 @@ static int pre_compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
continue;
mst_mgr = aconnector->port->mgr;
- mutex_lock(&mst_mgr->lock);
ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
&link_vars_start_index);
- mutex_unlock(&mst_mgr->lock);
if (ret != 0)
return ret;
--
2.37.3
WARNING: multiple messages have this Message-ID (diff)
From: Lyude Paul <lyude@redhat.com>
To: amd-gfx@lists.freedesktop.org
Cc: "open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
"Leo Li" <sunpeng.li@amd.com>,
"David Francis" <David.Francis@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Roman Li" <Roman.Li@amd.com>,
stable@vger.kernel.org,
"Nicholas Kazlauskas" <nicholas.kazlauskas@amd.com>,
"Wenjing Liu" <Wenjing.Liu@amd.com>,
"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
"hersen wu" <hersenxs.wu@amd.com>,
"Hamza Mahfooz" <hamza.mahfooz@amd.com>,
"Wayne Lin" <Wayne.Lin@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Mikita Lipski" <mikita.lipski@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 4/4] drm/amdgpu/dm/dp_mst: Don't grab mst_mgr->lock when computing DSC state
Date: Mon, 14 Nov 2022 17:17:55 -0500 [thread overview]
Message-ID: <20221114221754.385090-5-lyude@redhat.com> (raw)
In-Reply-To: <20221114221754.385090-1-lyude@redhat.com>
Now that we've fixed the issue with using the incorrect topology manager,
we're actually grabbing the topology manager's lock - and consequently
deadlocking. Luckily for us though, there's actually nothing in AMD's DSC
state computation code that really should need this lock. The one exception
is the mutex_lock() in dm_dp_mst_is_port_support_mode(), however we grab no
locks beneath &mgr->lock there so that should be fine to leave be.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Gitlab issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Fixes: 8c20a1ed9b4f ("drm/amd/display: MST DSC compute fair share")
Cc: <stable@vger.kernel.org> # v5.6+
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 5196c9a0e432d..59648f5ffb59d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -1148,10 +1148,8 @@ int compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
continue;
mst_mgr = aconnector->port->mgr;
- mutex_lock(&mst_mgr->lock);
ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
&link_vars_start_index);
- mutex_unlock(&mst_mgr->lock);
if (ret != 0)
return ret;
@@ -1208,10 +1206,8 @@ static int pre_compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
continue;
mst_mgr = aconnector->port->mgr;
- mutex_lock(&mst_mgr->lock);
ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
&link_vars_start_index);
- mutex_unlock(&mst_mgr->lock);
if (ret != 0)
return ret;
--
2.37.3
next prev parent reply other threads:[~2022-11-14 22:18 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 22:17 [PATCH v2 0/4] drm/amdgpu: Regression fixes from MST atomic-only conversion Lyude Paul
2022-11-14 22:17 ` [PATCH v2 1/4] drm/amdgpu/mst: Stop ignoring error codes and deadlocking Lyude Paul
2022-11-14 22:17 ` Lyude Paul
2022-11-14 22:17 ` Lyude Paul
2022-11-16 4:39 ` Lin, Wayne
2022-11-16 4:39 ` Lin, Wayne
2022-11-16 4:39 ` Lin, Wayne
2022-11-16 22:43 ` Lyude Paul
2022-11-16 22:43 ` Lyude Paul
2022-11-16 22:43 ` Lyude Paul
2022-11-18 19:17 ` Lyude Paul
2022-11-18 19:17 ` Lyude Paul
2022-11-18 19:17 ` Lyude Paul
2022-11-18 19:46 ` Alex Deucher
2022-11-18 19:46 ` Alex Deucher
2022-11-18 19:46 ` Alex Deucher
2022-11-18 19:47 ` Lyude Paul
2022-11-18 19:47 ` Lyude Paul
2022-11-18 19:47 ` Lyude Paul
2022-11-18 19:53 ` Lyude Paul
2022-11-18 19:53 ` Lyude Paul
2022-11-18 19:53 ` Lyude Paul
2022-11-18 20:06 ` Alex Deucher
2022-11-18 20:06 ` Alex Deucher
2022-11-18 20:06 ` Alex Deucher
2022-11-18 19:25 ` [PATCH v3] " Lyude Paul
2022-11-18 19:25 ` Lyude Paul
2022-11-18 19:25 ` Lyude Paul
2022-11-18 19:54 ` [v3] " Limonciello, Mario
2022-11-18 19:54 ` Limonciello, Mario
2022-11-18 19:54 ` Limonciello, Mario
2022-11-18 19:56 ` Lyude Paul
2022-11-18 19:56 ` Lyude Paul
2022-11-18 19:56 ` Lyude Paul
2022-11-14 22:17 ` [PATCH v2 2/4] drm/display/dp_mst: Fix drm_dp_mst_add_affected_dsc_crtcs() return code Lyude Paul
2022-11-14 22:17 ` Lyude Paul
2022-11-14 22:17 ` Lyude Paul
2022-11-14 22:17 ` [PATCH v2 3/4] drm/amdgpu/dm/mst: Use the correct topology mgr pointer in amdgpu_dm_connector Lyude Paul
2022-11-14 22:17 ` Lyude Paul
2022-11-14 22:17 ` Lyude Paul
2022-11-14 22:17 ` Lyude Paul [this message]
2022-11-14 22:17 ` [PATCH v2 4/4] drm/amdgpu/dm/dp_mst: Don't grab mst_mgr->lock when computing DSC state Lyude Paul
2022-11-14 22:17 ` Lyude Paul
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=20221114221754.385090-5-lyude@redhat.com \
--to=lyude@redhat.com \
--cc=David.Francis@amd.com \
--cc=Jerry.Zuo@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Roman.Li@amd.com \
--cc=Wayne.Lin@amd.com \
--cc=Wenjing.Liu@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamza.mahfooz@amd.com \
--cc=harry.wentland@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikita.lipski@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=stable@vger.kernel.org \
--cc=sunpeng.li@amd.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.