summaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2021-11-15 20:12:05 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-01-08 20:17:42 +0100
commit58d0b0a99275c35971d2e27d317013331bd3a8c0 (patch)
tree4fcd24b06c9b5ae572ef28be5c4c1d1510c4385a /drivers/net/can
parentd84ca2217b0065ec0f27a7c34ed073ed6449e213 (diff)
downloadlinux-58d0b0a99275c35971d2e27d317013331bd3a8c0.tar.bz2
can: mcp251xfd: mcp251xfd_handle_rxovif(): denote RX overflow message to debug + add rate limiting
A RX overflow usually happens during high system load. Printing overflow messages to the kernel log, which on embedded systems often is outputted on the serial console, even increases the system load. To decrease the system load in these situations, denote the messages to debug level and wrap them with net_ratelimit(). Link: https://lore.kernel.org/all/20220105154300.1258636-7-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index a01a3fc3b13c..105426dcf065 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -1652,12 +1652,15 @@ static int mcp251xfd_handle_rxovif(struct mcp251xfd_priv *priv)
/* If SERRIF is active, there was a RX MAB overflow. */
if (priv->regs_status.intf & MCP251XFD_REG_INT_SERRIF) {
- netdev_info(priv->ndev,
- "RX-%d: MAB overflow detected.\n",
- ring->nr);
+ if (net_ratelimit())
+ netdev_dbg(priv->ndev,
+ "RX-%d: MAB overflow detected.\n",
+ ring->nr);
} else {
- netdev_info(priv->ndev,
- "RX-%d: FIFO overflow.\n", ring->nr);
+ if (net_ratelimit())
+ netdev_dbg(priv->ndev,
+ "RX-%d: FIFO overflow.\n",
+ ring->nr);
}
err = regmap_update_bits(priv->map_reg,