From: Dengcheng Zhu <d...@wavecomp.com>

[ Upstream commit dc57aaf95a516f70e2d527d8287a0332c481a226 ]

After changing CPU online status, it will not be sent any IPIs such as in
__flush_cache_all() on software coherency systems. Do this before disabling
local IRQ.

Signed-off-by: Dengcheng Zhu <d...@wavecomp.com>
Signed-off-by: Paul Burton <paul.bur...@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/20571/
Cc: pbur...@wavecomp.com
Cc: r...@linux-mips.org
Cc: linux-m...@linux-mips.org
Cc: rachel.mo...@intel.com
Signed-off-by: Sasha Levin <sas...@kernel.org>
---
 arch/mips/kernel/crash.c         | 3 +++
 arch/mips/kernel/machine_kexec.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/arch/mips/kernel/crash.c b/arch/mips/kernel/crash.c
index d455363d51c3..4c07a43a3242 100644
--- a/arch/mips/kernel/crash.c
+++ b/arch/mips/kernel/crash.c
@@ -36,6 +36,9 @@ static void crash_shutdown_secondary(void *passed_regs)
        if (!cpu_online(cpu))
                return;
 
+       /* We won't be sent IPIs any more. */
+       set_cpu_online(cpu, false);
+
        local_irq_disable();
        if (!cpumask_test_cpu(cpu, &cpus_in_crash))
                crash_save_cpu(regs, cpu);
diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c
index 8b574bcd39ba..4b3726e4fe3a 100644
--- a/arch/mips/kernel/machine_kexec.c
+++ b/arch/mips/kernel/machine_kexec.c
@@ -118,6 +118,9 @@ machine_kexec(struct kimage *image)
                        *ptr = (unsigned long) phys_to_virt(*ptr);
        }
 
+       /* Mark offline BEFORE disabling local irq. */
+       set_cpu_online(smp_processor_id(), false);
+
        /*
         * we do not want to be bothered.
         */
-- 
2.17.1

Reply via email to