From: Ingo Molnar Date: Tue, 15 May 2018 06:10:50 +0000 (+0200) Subject: Merge tag 'v4.17-rc5' into locking/core, to pick up fixes X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=371b3269082500fc418043742467119ab0d224c6;p=linux.git Merge tag 'v4.17-rc5' into locking/core, to pick up fixes Signed-off-by: Ingo Molnar --- 371b3269082500fc418043742467119ab0d224c6 diff --cc kernel/stop_machine.c index c25ba18274fba,64c0291b579c9..f89014a2c2381 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@@ -78,14 -81,16 +81,16 @@@ static bool cpu_stop_queue_work(unsigne unsigned long flags; bool enabled; - spin_lock_irqsave(&stopper->lock, flags); + raw_spin_lock_irqsave(&stopper->lock, flags); enabled = stopper->enabled; if (enabled) - __cpu_stop_queue_work(stopper, work); + __cpu_stop_queue_work(stopper, work, &wakeq); else if (work->done) cpu_stop_signal_done(work->done); - spin_unlock_irqrestore(&stopper->lock, flags); + raw_spin_unlock_irqrestore(&stopper->lock, flags); + wake_up_q(&wakeq); + return enabled; } @@@ -229,10 -234,11 +234,11 @@@ static int cpu_stop_queue_two_works(in { struct cpu_stopper *stopper1 = per_cpu_ptr(&cpu_stopper, cpu1); struct cpu_stopper *stopper2 = per_cpu_ptr(&cpu_stopper, cpu2); + DEFINE_WAKE_Q(wakeq); int err; retry: - spin_lock_irq(&stopper1->lock); - spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING); + raw_spin_lock_irq(&stopper1->lock); + raw_spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING); err = -ENOENT; if (!stopper1->enabled || !stopper2->enabled) @@@ -252,11 -258,11 +258,11 @@@ goto unlock; err = 0; - __cpu_stop_queue_work(stopper1, work1); - __cpu_stop_queue_work(stopper2, work2); + __cpu_stop_queue_work(stopper1, work1, &wakeq); + __cpu_stop_queue_work(stopper2, work2, &wakeq); unlock: - spin_unlock(&stopper2->lock); - spin_unlock_irq(&stopper1->lock); + raw_spin_unlock(&stopper2->lock); + raw_spin_unlock_irq(&stopper1->lock); if (unlikely(err == -EDEADLK)) { while (stop_cpus_in_progress)