Commit 1b0d9224 authored by Wolfgang Grandegger's avatar Wolfgang Grandegger Committed by David S. Miller

can: switch carrier on if device was stopped while in bus-off state

This patch fixes a problem when a device is stopped while in the
bus-off state. Then the carrier remains off forever.
Signed-off-by: default avatarKurt Van Dijck <kurt.van.dijck@skynet.be>
Signed-off-by: default avatarWolfgang Grandegger <wg@grandegger.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3d0df7c
...@@ -473,6 +473,10 @@ int open_candev(struct net_device *dev) ...@@ -473,6 +473,10 @@ int open_candev(struct net_device *dev)
return -EINVAL; return -EINVAL;
} }
/* Switch carrier on if device was stopped while in bus-off state */
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev); setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment