Hi,
On 20/11/2026 14:54, Maxime Ripard wrote:
drm_atomic_get_connector_for_encoder() takes the connection mutex
through the acquire context it is given, looks up the connector routed
to an encoder, and releases the mutex before returning.
However, callers that need to look at the state of the connector they
just found have to take the connection mutex again afterwards, which
leaves a window where a concurrent commit can re-route the connector.
And if the caller already held the connection mutex through the same
acquire context, drm_atomic_get_connector_for_encoder() releases it
from under it.
Split the lookup into drm_atomic_get_connector_for_encoder_locked(),
which expects the caller to hold the connection mutex, and make
drm_atomic_get_connector_for_encoder() a wrapper around it that takes
and releases the mutex.
Signed-off-by: Maxime Ripard <[email protected]>
---
drivers/gpu/drm/drm_atomic.c | 57 ++++++++++++++++++++++++++++++++++----------
include/drm/drm_atomic.h | 2 ++
2 files changed, 46 insertions(+), 13 deletions(-)
Reviewed-by: Tomi Valkeinen <[email protected]>
Tomi