]> git.baikalelectronics.ru Git - kernel.git/commit
drm/dp_mst: Avoid to mess up payload table by ports in stale topology
authorWayne Lin <Wayne.Lin@amd.com>
Wed, 16 Jun 2021 03:55:01 +0000 (11:55 +0800)
committerLyude Paul <lyude@redhat.com>
Wed, 16 Jun 2021 16:57:46 +0000 (12:57 -0400)
commit6f5ada0fb4347c97f87c4ba57cf7ce16af08fd13
treec50833bb29955de61949eabbf8f8a1bc8c88c107
parent7744ae4305364b277cae98ece40116ee0f359ebb
drm/dp_mst: Avoid to mess up payload table by ports in stale topology

[Why]
After unplug/hotplug hub from the system, userspace might start to
clear stale payloads gradually. If we call drm_dp_mst_deallocate_vcpi()
to release stale VCPI of those ports which are not relating to current
topology, we have chane to wrongly clear active payload table entry for
current topology.

E.g.
We have allocated VCPI 1 in current payload table and we call
drm_dp_mst_deallocate_vcpi() to clean VCPI 1 in stale topology. In
drm_dp_mst_deallocate_vcpi(), it will call drm_dp_mst_put_payload_id()
tp put VCPI 1 and which means ID 1 is available again. Thereafter, if we
want to allocate a new payload stream, it will find ID 1 is available by
drm_dp_mst_assign_payload_id(). However, ID 1 is being used

[How]
Check target sink is relating to current topology or not before doing
any payload table update.
Searching upward to find the target sink's relevant root branch device.
If the found root branch device is not the same root of current
topology, don't update payload table.

Changes since v1:
* Change debug macro to use drm_dbg_kms() instead
* Amend the commit message to add Cc tag.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210616035501.3776-3-Wayne.Lin@amd.com
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/drm_dp_mst_topology.c