Skip to content

Commit

Permalink
drm/atomic: Call ww_acquire_done after check phase is complete
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
  • Loading branch information
danvet committed Aug 11, 2015
1 parent 460e8e2 commit 992cbf1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
EXPORT_SYMBOL(drm_atomic_check_only);
Expand Down

0 comments on commit 992cbf1

Please sign in to comment.