]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/bridge: prevent encoder chain changes while iterating with list_for_each_entry_re...
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Tue, 24 Mar 2026 08:58:13 +0000 (09:58 +0100)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 16 Apr 2026 07:08:42 +0000 (09:08 +0200)
commit82ce979b9be52fdc533c9e9aed965216e088200a
tree54a52954aab3acb9b1a9cb929e3d07db0bc45e7f
parentf776e9b8c290bab534b2699e6397456147c5a5a4
drm/bridge: prevent encoder chain changes while iterating with list_for_each_entry_reverse()

These loops in drm_bridge.c iterate over the encoder chain using
list_for_each_entry_reverse(), which does not prevent changes to the bridge
chain while iterating over it.

Take the encoder chain mutex while iterating to avoid chain changes while
iterating.

All the "simple" loops are converted. drm_atomic_bridge_chain_pre_enable()
and drm_atomic_bridge_chain_post_disable() are handled by a separate
commit.

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Link: https://patch.msgid.link/20260324-drm-bridge-alloc-encoder-chain-mutex-v5-6-8bf786c5c7e6@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/drm_bridge.c