Polling firmware requests system services with REQUEST set and NOTIFY
clear. Raising PLIC source 96 for those requests leaves an interrupt
pending that Linux can receive before submitting its first request.
The mailbox interrupt handler then has no response buffer to fill.
Raise the completion interrupt only for requests with NOTIFY set.
The serial-number service already checks REQUEST before processing a
command.
Fixes: 592f0a9429b9 ("hw/{misc, riscv}: pfsoc: add system controller as
unimplemented")
Signed-off-by: Bin Meng <[email protected]>
---
Changes in v3:
- Split the NOTIFY fix from interrupt acknowledgement wiring
hw/misc/mchp_pfsoc_ioscb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/misc/mchp_pfsoc_ioscb.c b/hw/misc/mchp_pfsoc_ioscb.c
index 850125c8b4..bde1917c10 100644
--- a/hw/misc/mchp_pfsoc_ioscb.c
+++ b/hw/misc/mchp_pfsoc_ioscb.c
@@ -247,7 +247,9 @@ static void services_cr_write(MchpPfSoCIoscbState *s,
uint32_t value)
}
s->services_sr = status << SERVICES_SR_STATUS_SHIFT;
- qemu_irq_raise(s->irq);
+ if (value & SERVICES_CR_NOTIFY) {
+ qemu_irq_raise(s->irq);
+ }
}
static uint64_t mchp_pfsoc_ctrl_read(void *opaque, hwaddr offset,
--
2.53.0