linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: m_can: Process interrupt only when not runtime suspended
@ 2020-09-15 13:47 Jarkko Nikula
  2020-11-18 15:23 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Jarkko Nikula @ 2020-09-15 13:47 UTC (permalink / raw)
  To: linux-can
  Cc: Dan Murphy, Sriram Dash, Marc Kleine-Budde, Patrik Flykt, 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.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
 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 02c5795b7393..81b32b03e246 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -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;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-18 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 13:47 [PATCH] can: m_can: Process interrupt only when not runtime suspended Jarkko Nikula
2020-11-18 15:23 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).