linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Torin Cooper-Bennun <torin@maxiluxsystems.com>
To: linux-can@vger.kernel.org
Cc: mkl@pengutronix.de, Torin Cooper-Bennun <torin@maxiluxsystems.com>
Subject: [PATCH] can: m_can: m_can_rx_peripheral: fix RX being blocked by errors
Date: Wed,  3 Mar 2021 14:43:51 +0000	[thread overview]
Message-ID: <20210303144350.4093750-1-torin@maxiluxsystems.com> (raw)

For M_CAN peripherals, m_can_rx_handler was called with quota = 1, which
caused any error handling to block RX from taking place until the next
time the IRQ handler is called. This had been observed to cause RX to be
blocked indefinitely in some cases.

This is fixed by calling m_can_rx_handler with a sensibly high quota.

Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Torin Cooper-Bennun <torin@maxiluxsystems.com>
---
 drivers/net/can/m_can/m_can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 3752520a7d4b..1f265895bf87 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -876,7 +876,7 @@ static int m_can_rx_peripheral(struct net_device *dev)
 {
 	struct m_can_classdev *cdev = netdev_priv(dev);
 
-	m_can_rx_handler(dev, 1);
+	m_can_rx_handler(dev, M_CAN_NAPI_WEIGHT);
 
 	m_can_enable_all_interrupts(cdev);
 
-- 
2.30.1


             reply	other threads:[~2021-03-04  0:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 14:43 Torin Cooper-Bennun [this message]
2021-03-04 13:57 ` [PATCH] can: m_can: m_can_rx_peripheral: fix RX being blocked by errors 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=20210303144350.4093750-1-torin@maxiluxsystems.com \
    --to=torin@maxiluxsystems.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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).