mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
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@tinylab.org/
Fixes: b17d19a531 ("riscv: kexec: Fixup irq controller broken in kexec crash path")
Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
Reviewed-by: Ryo Takakura <takakura@valinux.co.jp>
Link: https://lore.kernel.org/r/20240626023316.539971-1-songshuaishuai@tinylab.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b610a87538
commit
653deee48a
@@ -147,20 +147,12 @@ static void machine_kexec_mask_interrupts(void)
|
|||||||
|
|
||||||
for_each_irq_desc(i, desc) {
|
for_each_irq_desc(i, desc) {
|
||||||
struct irq_chip *chip;
|
struct irq_chip *chip;
|
||||||
int ret;
|
|
||||||
|
|
||||||
chip = irq_desc_get_chip(desc);
|
chip = irq_desc_get_chip(desc);
|
||||||
if (!chip)
|
if (!chip)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
|
||||||
* 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)
|
|
||||||
chip->irq_eoi(&desc->irq_data);
|
chip->irq_eoi(&desc->irq_data);
|
||||||
|
|
||||||
if (chip->irq_mask)
|
if (chip->irq_mask)
|
||||||
|
|||||||
Reference in New Issue
Block a user