Skip to content

Commit 1f83f5e

Browse files
MJNowakowskiralfbaechle
authored andcommitted
MIPS: Use common outgoing-CPU-notification code
Replace the open-coded CPU-offline notification with common code. In particular avoid calling scheduler code using RCU from an offline CPU that RCU is ignoring. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/15921/ Patchwork: https://patchwork.linux-mips.org/patch/15953/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 8bcd84a commit 1f83f5e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/mips/kernel/smp-cps.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* option) any later version.
99
*/
1010

11+
#include <linux/cpu.h>
1112
#include <linux/delay.h>
1213
#include <linux/io.h>
1314
#include <linux/irqchip/mips-gic.h>
@@ -408,7 +409,6 @@ static int cps_cpu_disable(void)
408409
return 0;
409410
}
410411

411-
static DECLARE_COMPLETION(cpu_death_chosen);
412412
static unsigned cpu_death_sibling;
413413
static enum {
414414
CPU_DEATH_HALT,
@@ -444,7 +444,7 @@ void play_dead(void)
444444
}
445445

446446
/* This CPU has chosen its way out */
447-
complete(&cpu_death_chosen);
447+
(void)cpu_report_death();
448448

449449
if (cpu_death == CPU_DEATH_HALT) {
450450
vpe_id = cpu_vpe_id(&cpu_data[cpu]);
@@ -493,8 +493,7 @@ static void cps_cpu_die(unsigned int cpu)
493493
int err;
494494

495495
/* Wait for the cpu to choose its way out */
496-
if (!wait_for_completion_timeout(&cpu_death_chosen,
497-
msecs_to_jiffies(5000))) {
496+
if (!cpu_wait_death(cpu, 5)) {
498497
pr_err("CPU%u: didn't offline\n", cpu);
499498
return;
500499
}

0 commit comments

Comments
 (0)