qemu-trivial
[Top][All Lists]
Advanced

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

[PATCH] net,can: fix sja1000 IER behavior


From: Алексей Каптур
Subject: [PATCH] net,can: fix sja1000 IER behavior
Date: Wed, 25 Oct 2023 17:30:08 +0300

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
 
 
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]