[PATCH] drm/atomic: do not call ww_acquire_done in drm_atomic_check_only

Inki Dae inki.dae at samsung.com
Sat Aug 15 20:20:51 PDT 2015

This patch fixes warning case when two more crtc driver are enabled
and two more atomic checking are tried at booting time.

With fbcon, modeset operation is performed at booting time.
In this case, if two mode crtc drivers are enabled, then
drm_atomic_check_only function will be called by restore_fbdev_mode
function - the value of fb_helper->crtc_count is bigger than 1 -
two more times. So that will incur warning by below line
of ww_acquire_done,
	ctx->done_acquire = 1;

ctx->done_acquire became 1 when drm_mode_set_config_internal for first
crtc driver was called, and then ctx->done_acquire becomes 2
when drm_mode_set_con_internal for second crtc driver was called.

So the function, ww_acqure_done(), should be called at more top function
than at drm_atomic_check_only() to make sure that no one tries to acquire
more locks.

Signed-off-by: Inki Dae <inki.dae at samsung.com>
 drivers/gpu/drm/drm_atomic.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 1066e4b..4349154 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1230,9 +1230,6 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
-	if (ret == 0)
-		ww_acquire_done(&state->acquire_ctx->ww_ctx);
 	return ret;

More information about the dri-devel mailing list