linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: linux-can@vger.kernel.org
Cc: Dan Murphy <dmurphy@ti.com>,
	Sriram Dash <sriram.dash@samsung.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Patrik Flykt <patrik.flykt@linux.intel.com>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>
Subject: [PATCH] can: m_can: Process interrupt only when not runtime suspended
Date: Tue, 15 Sep 2020 16:47:15 +0300	[thread overview]
Message-ID: <20200915134715.696303-1-jarkko.nikula@linux.intel.com> (raw)

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


             reply	other threads:[~2020-09-16  0:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 13:47 Jarkko Nikula [this message]
2020-11-18 15:23 ` [PATCH] can: m_can: Process interrupt only when not runtime suspended Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200915134715.696303-1-jarkko.nikula@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=dmurphy@ti.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=patrik.flykt@linux.intel.com \
    --cc=sriram.dash@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).