drm/atomic: Call ww_acquire_done after check phase is complete

This change “drm/atomic: Call ww_acquire_done after check phase is complete” in Linux kernel is authored by Daniel Vetter <daniel.vetter [at] ffwll.ch> on Thu Aug 6 15:06:40 2015 +0200.

drm/atomic: Call ww_acquire_done after check phase is complete

We want to make sure that no one tries to acquire more locks and
states, and ww mutexes provide debug facilities for that. So use them.

v2: Only call acquire_done when ->atomic_check was successful to avoid
falling over an -EDEADLK (spotted by Maarten).

Cc: Rob Clark <robdclark@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 992cbf1.

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/gpu/drm/drm_atomic.c | 3 +++
 1 file changed, 3 insertions(+)

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

The commit for this change in Linux stable tree is 992cbf1 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *