]> git.baikalelectronics.ru Git - kernel.git/commitdiff
can: dev: can_bus_off(): print scheduling of restart if activated
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 15 Sep 2020 22:35:03 +0000 (00:35 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 21 Sep 2020 08:13:17 +0000 (10:13 +0200)
If a CAN device goes into bus-off and has automatic restart enabled, inform
user that a automatic restart is scheduled after the configured delay.

Link: https://lore.kernel.org/r/20200915223527.1417033-14-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev.c

index e0caf969e3428bed7337ee338d52fa0e546f821c..3c40bba71d5b6e16396eae455d3f2ae993f74718 100644 (file)
@@ -639,7 +639,11 @@ void can_bus_off(struct net_device *dev)
 {
        struct can_priv *priv = netdev_priv(dev);
 
-       netdev_info(dev, "bus-off\n");
+       if (priv->restart_ms)
+               netdev_info(dev, "bus-off, scheduling restart in %d ms\n",
+                           priv->restart_ms);
+       else
+               netdev_info(dev, "bus-off\n");
 
        netif_carrier_off(dev);