X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=kernel%2Ffutex.c;h=4949d336d88d21edf82e51fceaa6b3960fad8790;hb=f579bbcd9bb8b688df03191b92c56ab8af4d6322;hp=c3bb2fce11ba2cb10bd69550f8cfc48b9638623c;hpb=da085681014fb43d67d9bf6d14bc068e9254bd49;p=mv-sheeva.git diff --git a/kernel/futex.c b/kernel/futex.c index c3bb2fce11b..4949d336d88 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1656,6 +1656,12 @@ out: static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, struct hrtimer_sleeper *timeout) { + /* + * The task state is guaranteed to be set before another task can + * wake it. set_current_state() is implemented using set_mb() and + * queue_me() calls spin_unlock() upon completion, both serializing + * access to the hash list and forcing another memory barrier. + */ set_current_state(TASK_INTERRUPTIBLE); queue_me(q, hb);