]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
LoongArch: Add machine_kexec_mask_interrupts() implementation
authorHuacai Chen <chenhuacai@loongson.cn>
Sat, 13 Dec 2025 09:49:50 +0000 (17:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:55:22 +0000 (13:55 +0100)
Commit 863a320dc6fd7c855f47da4b ("LoongArch: Mask all interrupts during
kexec/kdump") is backported to LTS branches, but they lack a generic
machine_kexec_mask_interrupts() implementation, so add an arch-specific
one.

Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/kernel/machine_kexec.c

index 8ef4e4595d61a372c7cec557b0772994a12d568f..19bd763263d36ebf2e039fd7460901553f27cbe6 100644 (file)
@@ -136,6 +136,28 @@ void kexec_reboot(void)
        BUG();
 }
 
+static void machine_kexec_mask_interrupts(void)
+{
+       unsigned int i;
+       struct irq_desc *desc;
+
+       for_each_irq_desc(i, desc) {
+               struct irq_chip *chip;
+
+               chip = irq_desc_get_chip(desc);
+               if (!chip)
+                       continue;
+
+               if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
+                       chip->irq_eoi(&desc->irq_data);
+
+               if (chip->irq_mask)
+                       chip->irq_mask(&desc->irq_data);
+
+               if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
+                       chip->irq_disable(&desc->irq_data);
+       }
+}
 
 #ifdef CONFIG_SMP
 static void kexec_shutdown_secondary(void *regs)