disp: msm: avoid deadlock by prepending connection_mutex

Commit caused by dpms on may use extra  modeset lock on
connection_mutex before msm_atomic_commit, so to avoid
deadlock, make the modeset lock within msm_atomic_commit
to be used before the waiting for pending_crtcs_event.

Change-Id: Ic43af0f775d87ccc1d145ead9cb2e1b65018c86f
Signed-off-by: Mahadevan <mahap@codeaurora.org>
This commit is contained in:
Mahadevan
2021-04-23 12:28:54 +05:30
committato da Nilaan Gunabalachandran
parent 78b4029179
commit a55a3dfe2a
2 ha cambiato i file con 11 aggiunte e 10 eliminazioni

Vedi File

@@ -714,6 +714,16 @@ int msm_atomic_commit(struct drm_device *dev,
c->plane_mask |= (1 << drm_plane_index(plane));
}
/* Protection for prepare_fence callback */
retry:
ret = drm_modeset_lock(&state->dev->mode_config.connection_mutex,
state->acquire_ctx);
if (ret == -EDEADLK) {
drm_modeset_backoff(state->acquire_ctx);
goto retry;
}
/*
* Wait for pending updates on any of the same crtc's and then
* mark our set of crtc's as busy: