Without this patch disabling interrupts through
IER (Interrupt Enable Register) doesn't work,
because interrupt status is changed only on
next SJA_CMR write or SJA_IR reading.
This behavior doesn't affect Linux kernel
because handling is done into interrupt
context, not in bottom half.
I tried to use bottom half and got interrupt
storm after masking IRQ.
So this patch fixes that behavior.
Signed-off-by: Alexey Kaptur <Alexey.Kaptur@kaspersky.com>
----
hw/net/can/can_sja1000.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c
index 73201f9139..bfab14de10 100644
--- a/hw/net/can/can_sja1000.c
+++ b/hw/net/can/can_sja1000.c
@@ -541,6 +541,7 @@ void can_sja_mem_write(CanSJA1000State *s, hwaddr addr, uint64_t val,
break; /* Do nothing */
case SJA_IER: /* Interrupt enable register */
s->interrupt_en = val;
+ can_sja_update_pel_irq(s);
break;
case 16: /* RX frame information addr16-28. */
s->status_pel |= (1 << 5); /* Set transmit status. */
--
2.25.1