diff options
author | Joonas Lahtinen <joonas.lahtinen@linux.intel.com> | 2021-09-20 15:30:41 +0300 |
---|---|---|
committer | Joonas Lahtinen <joonas.lahtinen@linux.intel.com> | 2021-09-20 16:00:43 +0300 |
commit | 9a6b201bd5e8b54610cf2fd54b44e36925c9d4b3 (patch) | |
tree | 64da21fd71dc7b3af7375ca49b1aa86a5c73a4e7 /include/linux/ww_mutex.h | |
parent | d0c560316d6fc7a2189bbb7acba929e81beabd01 (diff) | |
parent | 12235da8c80a1f9909008e4ca6036d5772b81192 (diff) |
Merge remote-tracking branch 'tip/locking/wwmutex' into drm-intel-gt-next
Needed by Maarten's series "drm/i915: Short-term pinning and async
eviction".
Link: https://lists.freedesktop.org/archives/intel-gfx/2021-September/277870.html
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'include/linux/ww_mutex.h')
-rw-r--r-- | include/linux/ww_mutex.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h index 29db736af86d..bb763085479a 100644 --- a/include/linux/ww_mutex.h +++ b/include/linux/ww_mutex.h @@ -28,12 +28,10 @@ #ifndef CONFIG_PREEMPT_RT #define WW_MUTEX_BASE mutex #define ww_mutex_base_init(l,n,k) __mutex_init(l,n,k) -#define ww_mutex_base_trylock(l) mutex_trylock(l) #define ww_mutex_base_is_locked(b) mutex_is_locked((b)) #else #define WW_MUTEX_BASE rt_mutex #define ww_mutex_base_init(l,n,k) __rt_mutex_init(l,n,k) -#define ww_mutex_base_trylock(l) rt_mutex_trylock(l) #define ww_mutex_base_is_locked(b) rt_mutex_base_is_locked(&(b)->rtmutex) #endif @@ -339,17 +337,8 @@ ww_mutex_lock_slow_interruptible(struct ww_mutex *lock, extern void ww_mutex_unlock(struct ww_mutex *lock); -/** - * ww_mutex_trylock - tries to acquire the w/w mutex without acquire context - * @lock: mutex to lock - * - * Trylocks a mutex without acquire context, so no deadlock detection is - * possible. Returns 1 if the mutex has been acquired successfully, 0 otherwise. - */ -static inline int __must_check ww_mutex_trylock(struct ww_mutex *lock) -{ - return ww_mutex_base_trylock(&lock->base); -} +extern int __must_check ww_mutex_trylock(struct ww_mutex *lock, + struct ww_acquire_ctx *ctx); /*** * ww_mutex_destroy - mark a w/w mutex unusable |