Skip to content

Commit

Permalink
can: switch carrier on if device was stopped while in bus-off state
Browse files Browse the repository at this point in the history
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 <kurt.van.dijck@skynet.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wolfgang Grandegger authored and David S. Miller committed Jul 20, 2009
1 parent b3d0df7 commit 1b0d922
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b0d922

Please sign in to comment.