ASoC: fsl: use snd_soc_xxx_active()
[linux-2.6-microblaze.git] / kernel / workqueue.c
index 3816a18..891ccad 100644 (file)
@@ -858,7 +858,8 @@ void wq_worker_running(struct task_struct *task)
  * @task: task going to sleep
  *
  * This function is called from schedule() when a busy worker is
- * going to sleep.
+ * going to sleep. Preemption needs to be disabled to protect ->sleeping
+ * assignment.
  */
 void wq_worker_sleeping(struct task_struct *task)
 {
@@ -875,7 +876,8 @@ void wq_worker_sleeping(struct task_struct *task)
 
        pool = worker->pool;
 
-       if (WARN_ON_ONCE(worker->sleeping))
+       /* Return if preempted before wq_worker_running() was reached */
+       if (worker->sleeping)
                return;
 
        worker->sleeping = 1;