Skip to contentSkip to conversation

can: m_can: Process interrupt only when not runtime suspended

PATCH In review Jarkko Nikula 2 participants 2 messages Sep 16, 2020 – Nov 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: m_can: Process interrupt only when not runtime suspended

Avoid processing bogus interrupt statuses when the HW is runtime suspended and the M_CAN_IR register read may get all bits 1's. Handler can be called if the interrupt request is shared with other peripherals or at the end of free_irq().

Therefore check the runtime suspended status before processing.

---
 drivers/net/can/m_can/m_can.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/can/m_can/m_can.c +2 -0
index 02c5795b7393..81b32b03e246 100644
@@ -956,6 +956,8 @@ static irqreturn_t m_can_isr(int irq, void *dev_id)
 	struct net_device_stats *stats = &dev->stats;
 	u32 ir;
 
+	if (pm_runtime_suspended(cdev->dev))
+		return IRQ_NONE;
 	ir = m_can_read(cdev, M_CAN_IR);
 	if (!ir)
 		return IRQ_NONE;
Signature · 1 line
2.28.0
#1 lore raw
Quoted 8 lines · Jarkko Nikula

Avoid processing bogus interrupt statuses when the HW is runtime suspended and the M_CAN_IR register read may get all bits 1's. Handler can be called if the interrupt request is shared with other peripherals or at the end of free_irq().

Therefore check the runtime suspended status before processing.

Applied to linux-can/testing

Tnx,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |