From 1b53a83600af89f42ad50bf747f08d1f5e00a935 Mon Sep 17 00:00:00 2001 From: Emmanuel Blot Date: Fri, 17 Oct 2025 12:39:19 +0200 Subject: [PATCH] [ot] hw/intc: sifive_plic: fix an old regression with lowered IRQs This led to lose any interrupt a device had raised then lowered before the PLIC got claimed. Upstream commit a84be2baa9 has been overridden by d5fbf92a3, which contains the invalid commit. Signed-off-by: Emmanuel Blot --- hw/intc/sifive_plic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c index 6678903c17c0..8ee65db229a4 100644 --- a/hw/intc/sifive_plic.c +++ b/hw/intc/sifive_plic.c @@ -385,10 +385,12 @@ static void sifive_plic_irq_request(void *opaque, int irq, int level) if (level && !sifive_plic_get_level(s, irq)) { sifive_plic_set_pending(s, irq, true); } + sifive_plic_set_level(s, irq, !!level); } else { - sifive_plic_set_pending(s, irq, level > 0); + if (level > 0) { + sifive_plic_set_pending(s, irq, true); + } } - sifive_plic_set_level(s, irq, !!level); sifive_plic_update(s); }