Patchwork drm/atomic: do not call ww_acquire_done in drm_atomic_check_only

mail settings
Submitter Inki Dae
Date Aug. 16, 2015, 3:20 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/7021741/
State New
Headers show


Inki Dae - Aug. 16, 2015, 3:20 a.m.
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 <>
 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;