summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@fedoraproject.org>2020-04-28 10:25:47 -0500
committerJustin M. Forbes <jforbes@fedoraproject.org>2020-04-28 10:25:47 -0500
commit3abb828534efb18b6c5002f944a93e3bd68d868e (patch)
tree31e8ef5766a62218a0707c7ad358765df2f1f7fb
parent81203d2e5f1c0aaab76584f04d51647c6efc736d (diff)
downloadkernel-3abb828534efb18b6c5002f944a93e3bd68d868e.tar.gz
kernel-3abb828534efb18b6c5002f944a93e3bd68d868e.tar.xz
kernel-3abb828534efb18b6c5002f944a93e3bd68d868e.zip
Fix drm_dp_send_dpcd_write() return code
-rw-r--r--drm-dp_mst-Fix-drm_dp_send_dpcd_write-return-code.patch47
-rw-r--r--kernel.spec5
2 files changed, 52 insertions, 0 deletions
diff --git a/drm-dp_mst-Fix-drm_dp_send_dpcd_write-return-code.patch b/drm-dp_mst-Fix-drm_dp_send_dpcd_write-return-code.patch
new file mode 100644
index 000000000..d5b7f003f
--- /dev/null
+++ b/drm-dp_mst-Fix-drm_dp_send_dpcd_write-return-code.patch
@@ -0,0 +1,47 @@
+From: Lyude Paul <lyude@redhat.com>
+Date: Fri, 24 Apr 2020 15:07:22 -0400
+Subject: drm/dp_mst: Fix drm_dp_send_dpcd_write() return code
+
+drm_dp_mst_wait_tx_reply() returns > 1 if time elapsed in
+wait_event_timeout() before check_txmsg_state(mgr, txmsg) evaluated to
+true. However, we make the mistake of returning this time from
+drm_dp_send_dpcd_write() on success instead of returning the number of
+bytes written - causing spontaneous failures during link probing:
+
+[drm:drm_dp_send_link_address [drm_kms_helper]] *ERROR* GUID check on
+10:01 failed: 3975
+
+Yikes! So, fix this by returning the number of bytes written on success
+instead.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Fixes: cb897542c6d2 ("drm/dp_mst: Fix W=1 warnings")
+Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
+Cc: Sean Paul <sean@poorly.run>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Sean Paul <sean@poorly.run>
+Link: https://patchwork.freedesktop.org/patch/msgid/20200424190722.775284-1-lyude@redhat.com
+---
+ drivers/gpu/drm/drm_dp_mst_topology.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+
+diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
+index 03a1496f6120..21dc78cb4ba6 100644
+--- a/drivers/gpu/drm/drm_dp_mst_topology.c
++++ b/drivers/gpu/drm/drm_dp_mst_topology.c
+@@ -3436,8 +3436,12 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr,
+ drm_dp_queue_down_tx(mgr, txmsg);
+
+ ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
+- if (ret > 0 && txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
+- ret = -EIO;
++ if (ret > 0) {
++ if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
++ ret = -EIO;
++ else
++ ret = size;
++ }
+
+ kfree(txmsg);
+ fail_put:
diff --git a/kernel.spec b/kernel.spec
index 981f7a1f3..55ae33832 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -901,6 +901,8 @@ Patch509: drm-i915-backports.patch
# https://patchwork.ozlabs.org/patch/1260523/
Patch511: e1000e-bump-up-timeout-to-wait-when-ME-un-configure-ULP-mode.patch
+Patch512: drm-dp_mst-Fix-drm_dp_send_dpcd_write-return-code.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -2996,6 +2998,9 @@ fi
#
#
%changelog
+* Tue Apr 28 2020 Justin M. Forbes <jforbes@fedoraproject.org>
+- MST Fix from Lyude Paul
+
* Thu Apr 23 2020 Justin M. Forbes <jforbes@fedoraproject.org> - 5.6.7-300
- Linux v5.6.7