mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] can: m_can: apply rate-limiting to lost msg in rx
@ 2025-06-20 10:00 Sean Nyekjaer
  2025-06-21  2:13 ` Vincent Mailhol
  0 siblings, 1 reply; 5+ messages in thread
From: Sean Nyekjaer @ 2025-06-20 10:00 UTC (permalink / raw)
  To: Chandrasekar Ramakrishnan, Marc Kleine-Budde, Vincent Mailhol,
	Fengguang Wu, Varka Bhadram, Dong Aisheng
  Cc: linux-can, linux-kernel, Sean Nyekjaer

Wrap the "msg lost in rxf0" error in m_can_handle_lost_msg() with
a call to net_ratelimit() to prevent flooding the kernel log
with repeated error messages.

Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support")
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
 drivers/net/can/m_can/m_can.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 6c656bfdb3235e1f5d6405c49b07b821ddacc1b9..b0638d23879cf4257b8f4555d1123f45f9595ad7 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -665,7 +665,8 @@ static int m_can_handle_lost_msg(struct net_device *dev)
 	struct can_frame *frame;
 	u32 timestamp = 0;
 
-	netdev_err(dev, "msg lost in rxf0\n");
+	if (net_ratelimit())
+		netdev_err(dev, "msg lost in rxf0\n");
 
 	stats->rx_errors++;
 	stats->rx_over_errors++;

---
base-commit: db22720545207f734aaa9d9f71637bfc8b0155e0
change-id: 20250620-mcan_ratelimit-e7e1f9d8fa9c

Best regards,
-- 
Sean Nyekjaer <sean@geanix.com>


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

end of thread, other threads:[~2025-06-26 14:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-20 10:00 [PATCH] can: m_can: apply rate-limiting to lost msg in rx Sean Nyekjaer
2025-06-21  2:13 ` Vincent Mailhol
2025-06-26 13:45   ` Sean Nyekjaer
2025-06-26 13:57     ` Marc Kleine-Budde
2025-06-26 14:46       ` Vincent Mailhol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®