summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/mutex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/mutex.c b/kernel/mutex.c
index ad53a664f113..ee2254231661 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -137,8 +137,8 @@ void mspin_lock(struct mspin_node **lock, struct mspin_node *node)
ACCESS_ONCE(prev->next) = node;
smp_wmb();
/* Wait until the lock holder passes the lock down */
- while (!ACCESS_ONCE(node->locked))
- arch_mutex_cpu_relax();
+ while (!cpu_relaxed_read(&(node->locked)))
+ cpu_read_relax();
}
static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
@@ -152,8 +152,8 @@ static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
if (cmpxchg(lock, node, NULL) == node)
return;
/* Wait until the next pointer is set */
- while (!(next = ACCESS_ONCE(node->next)))
- arch_mutex_cpu_relax();
+ while (!(next = cpu_relaxed_read_long(&(node->next))))
+ cpu_read_relax();
}
ACCESS_ONCE(next->locked) = 1;
smp_wmb();