From: Jarkko Nikula Date: Tue, 15 Sep 2020 13:47:15 +0000 (+0300) Subject: can: m_can: process interrupt only when not runtime suspended X-Git-Tag: v5.15~2389^2~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1f634463aaf2c94dfa13001dbdea011303124cc;p=platform%2Fkernel%2Flinux-starfive.git 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. Fixes: cdf8259d6573 ("can: m_can: Add PM Support") Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20200915134715.696303-1-jarkko.nikula@linux.intel.com Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index e726404..f3fc37e 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;