Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:40 +0100
commit3786f972b1c439c2cf40671fa922abdee14afb0d (patch)
tree8dc4e1f27edda7a10a194a700cde7b5912b0b38e
parentd808fab934a29f72675a168aec55b641393c5be0 (diff)
drm/amdgpu: Don't ignore rc from
drm_dp_mst_topology_mgr_resume() (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-044-drm-amdgpu-Don-t-ignore-rc-from-drm_dp_mst_top.patch89
-rw-r--r--series.conf1
2 files changed, 90 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-044-drm-amdgpu-Don-t-ignore-rc-from-drm_dp_mst_top.patch b/patches.kernel.org/4.20.3-044-drm-amdgpu-Don-t-ignore-rc-from-drm_dp_mst_top.patch
new file mode 100644
index 0000000000..eda41cf772
--- /dev/null
+++ b/patches.kernel.org/4.20.3-044-drm-amdgpu-Don-t-ignore-rc-from-drm_dp_mst_top.patch
@@ -0,0 +1,89 @@
+From: Lyude Paul <lyude@redhat.com>
+Date: Tue, 8 Jan 2019 16:11:27 -0500
+Subject: [PATCH] drm/amdgpu: Don't ignore rc from
+ drm_dp_mst_topology_mgr_resume()
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: fe7553bef8d676d1d8b40666868b33ec39b9df5d
+
+commit fe7553bef8d676d1d8b40666868b33ec39b9df5d upstream.
+
+drm_dp_mst_topology_mgr_resume() returns whether or not it managed to
+find the topology in question after a suspend resume cycle, and the
+driver is supposed to check this value and disable MST accordingly if
+it's gone-in addition to sending a hotplug in order to notify userspace
+that something changed during suspend.
+
+Currently, amdgpu just makes the mistake of ignoring the return code
+from drm_dp_mst_topology_mgr_resume() which means that if a topology was
+removed in suspend, amdgpu never notices and assumes it's still
+connected which leads to all sorts of problems.
+
+So, fix this by actually checking the rc from
+drm_dp_mst_topology_mgr_resume(). Also, reformat the rest of the
+function while we're at it to fix the over-indenting.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Cc: Jerry Zuo <Jerry.Zuo@amd.com>
+Cc: <stable@vger.kernel.org> # v4.15+
+Link: https://patchwork.freedesktop.org/patch/msgid/20190108211133.32564-2-lyude@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 +++++++++++++------
+ 1 file changed, 23 insertions(+), 9 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 5a6edf65c9ea..6677f5e6c79b 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -645,22 +645,36 @@ static void s3_handle_mst(struct drm_device *dev, bool suspend)
+ {
+ struct amdgpu_dm_connector *aconnector;
+ struct drm_connector *connector;
++ struct drm_dp_mst_topology_mgr *mgr;
++ int ret;
++ bool need_hotplug = false;
+
+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
+
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+- aconnector = to_amdgpu_dm_connector(connector);
+- if (aconnector->dc_link->type == dc_connection_mst_branch &&
+- !aconnector->mst_port) {
++ list_for_each_entry(connector, &dev->mode_config.connector_list,
++ head) {
++ aconnector = to_amdgpu_dm_connector(connector);
++ if (aconnector->dc_link->type != dc_connection_mst_branch ||
++ aconnector->mst_port)
++ continue;
++
++ mgr = &aconnector->mst_mgr;
+
+- if (suspend)
+- drm_dp_mst_topology_mgr_suspend(&aconnector->mst_mgr);
+- else
+- drm_dp_mst_topology_mgr_resume(&aconnector->mst_mgr);
+- }
++ if (suspend) {
++ drm_dp_mst_topology_mgr_suspend(mgr);
++ } else {
++ ret = drm_dp_mst_topology_mgr_resume(mgr);
++ if (ret < 0) {
++ drm_dp_mst_topology_mgr_set_mst(mgr, false);
++ need_hotplug = true;
++ }
++ }
+ }
+
+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
++
++ if (need_hotplug)
++ drm_kms_helper_hotplug_event(dev);
+ }
+
+ static int dm_hw_init(void *handle)
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index eed253584d..e7146fce0c 100644
--- a/series.conf
+++ b/series.conf
@@ -281,6 +281,7 @@
patches.kernel.org/4.20.3-041-drm-amd-display-Fix-MST-dp_blank-REG_WAIT-time.patch
patches.kernel.org/4.20.3-042-drm-fb-helper-Partially-bring-back-workaround-.patch
patches.kernel.org/4.20.3-043-drm-i915-Unwind-failure-on-pinning-the-gen7-pp.patch
+ patches.kernel.org/4.20.3-044-drm-amdgpu-Don-t-ignore-rc-from-drm_dp_mst_top.patch
########################################################
# Build fixes that apply to the vanilla kernel too.