summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2022-12-14 20:42:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 13:50:48 +0100
commit5b8f79af9f270021b9d3a90f2d92869b64430125 (patch)
treeded640debfb390864fbd5b9ba4e50363e6e0de5e
parentdrm/display/dp_mst: Fix down message handling after a packet reception error (diff)
downloadlinux-stable-5b8f79af9f270021b9d3a90f2d92869b64430125.tar.xz
linux-stable-5b8f79af9f270021b9d3a90f2d92869b64430125.zip
drm/display/dp_mst: Fix payload addition on a disconnected sink
commit 33f960e23c29d113fe3193e0bdc19ac4f3776f20 upstream. If an MST stream is enabled on a disconnected sink, the payload for the stream is not created and the MST manager's payload count/next start VC slot is not updated. Since the payload's start VC slot may still contain a valid value (!= -1) the subsequent disabling of such a stream could cause an incorrect decrease of the payload count/next start VC slot in drm_dp_remove_payload() and hence later payload additions will fail. Fix the above by marking the payload as invalid in the above case, so that it's skipped during payload removal. While at it add a debug print for this case. Cc: Lyude Paul <lyude@redhat.com> Cc: <stable@vger.kernel.org> # v6.1+ Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221214184258.2869417-3-imre.deak@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/gpu/drm/display/drm_dp_mst_topology.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index d77858c7c4db..e77c674b37ca 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -3309,8 +3309,13 @@ int drm_dp_add_payload_part1(struct drm_dp_mst_topology_mgr *mgr,
int ret;
port = drm_dp_mst_topology_get_port_validated(mgr, payload->port);
- if (!port)
+ if (!port) {
+ drm_dbg_kms(mgr->dev,
+ "VCPI %d for port %p not in topology, not creating a payload\n",
+ payload->vcpi, payload->port);
+ payload->vc_start_slot = -1;
return 0;
+ }
if (mgr->payload_count == 0)
mgr->next_start_slot = mst_state->start_slot;