diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2011-10-20 18:30:25 +0200 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-20 18:30:25 +0200 |
| commit | 995a0605a6665858d73f9e80053414909be33f27 (patch) | |
| tree | fcc66a6a77acdaae492f77c0c58c0233db74a2b4 /kernel/workqueue.c | |
| parent | a32750c2ca6f697903b19063fc86f4272865e3a1 (diff) | |
| parent | 677d3e2f07d1b3d6d2f76fd5552d16a53b9236a0 (diff) | |
Merge branch 'at91/trng' into next/driver
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 25fb1b0e53f..1783aabc612 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -2412,8 +2412,13 @@ reflush: for_each_cwq_cpu(cpu, wq) { struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); + bool drained; - if (!cwq->nr_active && list_empty(&cwq->delayed_works)) + spin_lock_irq(&cwq->gcwq->lock); + drained = !cwq->nr_active && list_empty(&cwq->delayed_works); + spin_unlock_irq(&cwq->gcwq->lock); + + if (drained) continue; if (++flush_cnt == 10 || |
