* [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
* Re: [PATCH] can: m_can: Process interrupt only when not runtime suspended
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
0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2020-11-18 15:23 UTC (permalink / raw)
To: Jarkko Nikula, linux-can; +Cc: Dan Murphy, Sriram Dash, Patrik Flykt
[-- Attachment #1.1: Type: text/plain, Size: 749 bytes --]
On 9/15/20 3:47 PM, Jarkko Nikula wrote:
> 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>
Applied to linux-can/testing
Tnx,
Marc
--
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 |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.