]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
LoongArch: Mask all interrupts during kexec/kdump
authorHuacai Chen <chenhuacai@loongson.cn>
Thu, 20 Nov 2025 06:42:05 +0000 (14:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Dec 2025 17:40:22 +0000 (18:40 +0100)
[ Upstream commit 863a320dc6fd7c855f47da4bb82a8de2d9102ea2 ]

If the default state of the interrupt controllers in the first kernel
don't mask any interrupts, it may cause the second kernel to potentially
receive interrupts (which were previously allocated by the first kernel)
immediately after a CPU becomes online during its boot process. These
interrupts cannot be properly routed, leading to bad IRQ issues.

This patch calls machine_kexec_mask_interrupts() to mask all interrupts
during the kexec/kdump process.

Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/kernel/machine_kexec.c

index f9381800e291cc2989bc9d6a01a44a049e8191d0..8ef4e4595d61a372c7cec557b0772994a12d568f 100644 (file)
@@ -249,6 +249,7 @@ void machine_crash_shutdown(struct pt_regs *regs)
 #ifdef CONFIG_SMP
        crash_smp_send_stop();
 #endif
+       machine_kexec_mask_interrupts();
        cpumask_set_cpu(crashing_cpu, &cpus_in_crash);
 
        pr_info("Starting crashdump kernel...\n");
@@ -286,6 +287,7 @@ void machine_kexec(struct kimage *image)
 
        /* We do not want to be bothered. */
        local_irq_disable();
+       machine_kexec_mask_interrupts();
 
        pr_notice("EFI boot flag 0x%lx\n", efi_boot);
        pr_notice("Command line at 0x%lx\n", cmdline_ptr);