From: Wolfgang Grandegger Date: Mon, 20 Jul 2009 04:06:41 +0000 (+0000) Subject: can: switch carrier on if device was stopped while in bus-off state X-Git-Tag: MMI-PSA29.97-13-9~27020^2~147 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b0d92244ff2434a98272f6d2525da32fc230f19;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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: Kurt Van Dijck Signed-off-by: Wolfgang Grandegger Signed-off-by: David S. Miller --- diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 06083c32869a..9e4283aff828 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -473,6 +473,10 @@ int open_candev(struct net_device *dev) 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); return 0;