Patch "riscv: kexec: Avoid deadlock in kexec crash path" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    riscv: kexec: Avoid deadlock in kexec crash path

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     riscv-kexec-avoid-deadlock-in-kexec-crash-path.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cea3b6027dc01bccbb94fcdc15617d90aa39aa75
Author: Song Shuai <songshuaishuai@xxxxxxxxxxx>
Date:   Wed Jun 26 10:33:16 2024 +0800

    riscv: kexec: Avoid deadlock in kexec crash path
    
    [ Upstream commit c562ba719df570c986caf0941fea2449150bcbc4 ]
    
    If the kexec crash code is called in the interrupt context, the
    machine_kexec_mask_interrupts() function will trigger a deadlock while
    trying to acquire the irqdesc spinlock and then deactivate irqchip in
    irq_set_irqchip_state() function.
    
    Unlike arm64, riscv only requires irq_eoi handler to complete EOI and
    keeping irq_set_irqchip_state() will only leave this possible deadlock
    without any use. So we simply remove it.
    
    Link: https://lore.kernel.org/linux-riscv/20231208111015.173237-1-songshuaishuai@xxxxxxxxxxx/
    Fixes: b17d19a5314a ("riscv: kexec: Fixup irq controller broken in kexec crash path")
    Signed-off-by: Song Shuai <songshuaishuai@xxxxxxxxxxx>
    Reviewed-by: Ryo Takakura <takakura@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240626023316.539971-1-songshuaishuai@xxxxxxxxxxx
    Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/riscv/kernel/machine_kexec.c b/arch/riscv/kernel/machine_kexec.c
index 2d139b724bc84..ccb0c5d5c63c4 100644
--- a/arch/riscv/kernel/machine_kexec.c
+++ b/arch/riscv/kernel/machine_kexec.c
@@ -147,20 +147,12 @@ static void machine_kexec_mask_interrupts(void)
 
 	for_each_irq_desc(i, desc) {
 		struct irq_chip *chip;
-		int ret;
 
 		chip = irq_desc_get_chip(desc);
 		if (!chip)
 			continue;
 
-		/*
-		 * First try to remove the active state. If this
-		 * fails, try to EOI the interrupt.
-		 */
-		ret = irq_set_irqchip_state(i, IRQCHIP_STATE_ACTIVE, false);
-
-		if (ret && irqd_irq_inprogress(&desc->irq_data) &&
-		    chip->irq_eoi)
+		if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
 			chip->irq_eoi(&desc->irq_data);
 
 		if (chip->irq_mask)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux