Maxime Ripard <[email protected]> writes: > drm_bridge_helper_reset_crtc() takes the connection mutex using the > acquire context provided by the caller, and then relies on > drm_atomic_get_connector_for_encoder() and > drm_atomic_helper_reset_crtc() that both use the same context. > > However, drm_atomic_get_connector_for_encoder() takes the connection > mutex itself and unlocks it on its way out. The connection mutex taken > by drm_bridge_helper_reset_crtc() was thus already released when the > function unlocked it again on its exit path, and the connector state > was looked at without holding it. > > The callers already have to release the context locks through > drm_modeset_drop_locks() and to handle the -EDEADLK error, so we can > leave the connection mutex release to them. Look the connector up with > drm_atomic_get_connector_for_encoder_locked() instead, so that the > connection mutex stays held from the lookup until the CRTC reset, and > make sure the connector is bound to a CRTC before resetting it. > > Fixes: 56ae62124177 ("drm/bridge: Add helper to reset bridge pipeline") > Signed-off-by: Maxime Ripard <[email protected]> > ---
Acked-by: Javier Martinez Canillas <[email protected]> -- Best regards, Javier Martinez Canillas Core Platforms Red Hat
