|
@@ -1669,31 +1669,14 @@ void rt_mutex_proxy_unlock(struct rt_mutex *lock,
|
|
|
rt_mutex_set_owner(lock, NULL);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * rt_mutex_start_proxy_lock() - Start lock acquisition for another task
|
|
|
- * @lock: the rt_mutex to take
|
|
|
- * @waiter: the pre-initialized rt_mutex_waiter
|
|
|
- * @task: the task to prepare
|
|
|
- *
|
|
|
- * Returns:
|
|
|
- * 0 - task blocked on lock
|
|
|
- * 1 - acquired the lock for task, caller should wake it up
|
|
|
- * <0 - error
|
|
|
- *
|
|
|
- * Special API call for FUTEX_REQUEUE_PI support.
|
|
|
- */
|
|
|
-int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
|
|
|
+int __rt_mutex_start_proxy_lock(struct rt_mutex *lock,
|
|
|
struct rt_mutex_waiter *waiter,
|
|
|
struct task_struct *task)
|
|
|
{
|
|
|
int ret;
|
|
|
|
|
|
- raw_spin_lock_irq(&lock->wait_lock);
|
|
|
-
|
|
|
- if (try_to_take_rt_mutex(lock, task, NULL)) {
|
|
|
- raw_spin_unlock_irq(&lock->wait_lock);
|
|
|
+ if (try_to_take_rt_mutex(lock, task, NULL))
|
|
|
return 1;
|
|
|
- }
|
|
|
|
|
|
/* We enforce deadlock detection for futexes */
|
|
|
ret = task_blocks_on_rt_mutex(lock, waiter, task,
|
|
@@ -1712,13 +1695,37 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
|
|
|
if (unlikely(ret))
|
|
|
remove_waiter(lock, waiter);
|
|
|
|
|
|
- raw_spin_unlock_irq(&lock->wait_lock);
|
|
|
-
|
|
|
debug_rt_mutex_print_deadlock(waiter);
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * rt_mutex_start_proxy_lock() - Start lock acquisition for another task
|
|
|
+ * @lock: the rt_mutex to take
|
|
|
+ * @waiter: the pre-initialized rt_mutex_waiter
|
|
|
+ * @task: the task to prepare
|
|
|
+ *
|
|
|
+ * Returns:
|
|
|
+ * 0 - task blocked on lock
|
|
|
+ * 1 - acquired the lock for task, caller should wake it up
|
|
|
+ * <0 - error
|
|
|
+ *
|
|
|
+ * Special API call for FUTEX_REQUEUE_PI support.
|
|
|
+ */
|
|
|
+int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
|
|
|
+ struct rt_mutex_waiter *waiter,
|
|
|
+ struct task_struct *task)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ raw_spin_lock_irq(&lock->wait_lock);
|
|
|
+ ret = __rt_mutex_start_proxy_lock(lock, waiter, task);
|
|
|
+ raw_spin_unlock_irq(&lock->wait_lock);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* rt_mutex_next_owner - return the next owner of the lock
|
|
|
*
|