[PATCH] can: m_can: m_can_isr(): disable mcan interrupts during tefn handling

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

 



Under high mixed RX/TX interrupt load, the tcan4x5x's nINT signal
sometimes stays asserted, blocking any further interrupts.
Register M_CAN_IR is then set to 0x580d and never recovers.
This is caused by interrupts occurring during interrupt handling.
Disable MCAN interrupts during TX irq flag processing (from interrupt
context), as is the case for the RX irq flag processing.

Link: https://lore.kernel.org/linux-can/20220403105730.fnurim5vnnuxb7s5@xxxxxxxxxxxxxx
Signed-off-by: Wouter van Herpen <wouter.van.herpen@xxxxxxxxxxxxxxxxxxxxxxxxx>
---
Please note this patch was generated and tested with kernel base v5.4.
In the most recent kernel version, this patch is still required to fix
the issue described.

 drivers/net/can/m_can/m_can.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 562c8317e3aa..8cea1b946b71 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -949,11 +949,13 @@ static irqreturn_t m_can_isr(int irq, void *dev_id)
 	} else  {
 		if (ir & IR_TEFN) {
 			/* New TX FIFO Element arrived */
+			m_can_disable_all_interrupts(cdev);
 			m_can_echo_tx_event(dev);
 			can_led_event(dev, CAN_LED_EVENT_TX);
 			if (netif_queue_stopped(dev) &&
 			    !m_can_tx_fifo_full(cdev))
 				netif_wake_queue(dev);
+			m_can_enable_all_interrupts(cdev);
 		}
 	}
 

base-commit: 219d54332a09e8d8741c1e1982f5eae56099de85
-- 
2.30.2




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux