All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: m_can: m_can_rx_peripheral: fix RX being blocked by errors
@ 2021-03-03 14:43 Torin Cooper-Bennun
  2021-03-04 13:57 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Torin Cooper-Bennun @ 2021-03-03 14:43 UTC (permalink / raw)
  To: linux-can; +Cc: mkl, Torin Cooper-Bennun

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


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

* Re: [PATCH] can: m_can: m_can_rx_peripheral: fix RX being blocked by errors
  2021-03-03 14:43 [PATCH] can: m_can: m_can_rx_peripheral: fix RX being blocked by errors Torin Cooper-Bennun
@ 2021-03-04 13:57 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2021-03-04 13:57 UTC (permalink / raw)
  To: Torin Cooper-Bennun; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

On 03.03.2021 14:43:51, Torin Cooper-Bennun wrote:
> 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>

Applied to linux-can/testing.

Thanks,
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: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-03-04 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 14:43 [PATCH] can: m_can: m_can_rx_peripheral: fix RX being blocked by errors Torin Cooper-Bennun
2021-03-04 13:57 ` 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.