diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2015-08-27 13:58:09 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-09-08 13:45:53 +0200 |
commit | 825926d8e0bfa6f933706236603bb74a8cea002c (patch) | |
tree | d885c31029ec745b61f791aa0ef48ed6e84c9b49 | |
parent | 53edb2c62e1a884f53a74899cc7e9558fd89051a (diff) | |
download | linux-825926d8e0bfa6f933706236603bb74a8cea002c.tar.gz linux-825926d8e0bfa6f933706236603bb74a8cea002c.tar.bz2 linux-825926d8e0bfa6f933706236603bb74a8cea002c.zip |
drm/atomic: Make sure lock is held in trylock contexts.
This will make sure we get a lockdep spat in all cases
even if the context is a complete garbage pointer.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_modeset_lock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c index fba321ca4344..6675b1428410 100644 --- a/drivers/gpu/drm/drm_modeset_lock.c +++ b/drivers/gpu/drm/drm_modeset_lock.c @@ -307,6 +307,8 @@ static inline int modeset_lock(struct drm_modeset_lock *lock, WARN_ON(ctx->contended); if (ctx->trylock_only) { + lockdep_assert_held(&ctx->ww_ctx); + if (!ww_mutex_trylock(&lock->mutex)) return -EBUSY; else |