Commit 1f83f5e4 authored by Marcin Nowakowski's avatar Marcin Nowakowski Committed by Ralf Baechle

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: default avatarMarcin 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent 8bcd84a4
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* option) any later version. * option) any later version.
*/ */
#include <linux/cpu.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/irqchip/mips-gic.h> #include <linux/irqchip/mips-gic.h>
...@@ -408,7 +409,6 @@ static int cps_cpu_disable(void) ...@@ -408,7 +409,6 @@ static int cps_cpu_disable(void)
return 0; return 0;
} }
static DECLARE_COMPLETION(cpu_death_chosen);
static unsigned cpu_death_sibling; static unsigned cpu_death_sibling;
static enum { static enum {
CPU_DEATH_HALT, CPU_DEATH_HALT,
...@@ -444,7 +444,7 @@ void play_dead(void) ...@@ -444,7 +444,7 @@ void play_dead(void)
} }
/* This CPU has chosen its way out */ /* This CPU has chosen its way out */
complete(&cpu_death_chosen); (void)cpu_report_death();
if (cpu_death == CPU_DEATH_HALT) { if (cpu_death == CPU_DEATH_HALT) {
vpe_id = cpu_vpe_id(&cpu_data[cpu]); vpe_id = cpu_vpe_id(&cpu_data[cpu]);
...@@ -493,8 +493,7 @@ static void cps_cpu_die(unsigned int cpu) ...@@ -493,8 +493,7 @@ static void cps_cpu_die(unsigned int cpu)
int err; int err;
/* Wait for the cpu to choose its way out */ /* Wait for the cpu to choose its way out */
if (!wait_for_completion_timeout(&cpu_death_chosen, if (!cpu_wait_death(cpu, 5)) {
msecs_to_jiffies(5000))) {
pr_err("CPU%u: didn't offline\n", cpu); pr_err("CPU%u: didn't offline\n", cpu);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment