drm/display/dp_mst: Fix payload addition on a disconnected sink
authorImre Deak <imre.deak@intel.com>
Wed, 14 Dec 2022 18:42:58 +0000 (20:42 +0200)
committerImre Deak <imre.deak@intel.com>
Fri, 16 Dec 2022 14:55:29 +0000 (16:55 +0200)
commit33f960e23c29d113fe3193e0bdc19ac4f3776f20
treedbc7795c33693fcc10c5c2381c9e61a50b970294
parent1241aedb6b5c7a5a8ad73e5eb3a41cfe18a3e00e
drm/display/dp_mst: Fix payload addition on a disconnected sink

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
drivers/gpu/drm/display/drm_dp_mst_topology.c