aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJan Altenberg <jan@linutronix.de>2011-03-21 21:19:26 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-21 21:19:26 -0400
commit4f2d56c45fec7c15169599cab05e9f6df18769d0 (patch)
treee6ef8a3050e4a893e9e58c789dfe9289867ee9aa /drivers/net
parentb20e7bbfc7a15a4182730f0936433145992b4b06 (diff)
can: c_can: Do basic c_can configuration _before_ enabling the interrupts
I ran into some trouble while testing the SocketCAN driver for the BOSCH C_CAN controller. The interface is not correctly initialized, if I put some CAN traffic on the line, _while_ the interface is being started (which means: the interface doesn't come up correcty, if there's some RX traffic while doing 'ifconfig can0 up'). The current implementation enables the controller interrupts _before_ doing the basic c_can configuration. I think, this should be done the other way round. The patch below fixes things for me. Signed-off-by: Jan Altenberg <jan@linutronix.de> Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/can/c_can/c_can.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 14050786218a..110eda01843c 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -633,9 +633,6 @@ static void c_can_start(struct net_device *dev)
633{ 633{
634 struct c_can_priv *priv = netdev_priv(dev); 634 struct c_can_priv *priv = netdev_priv(dev);
635 635
636 /* enable status change, error and module interrupts */
637 c_can_enable_all_interrupts(priv, ENABLE_ALL_INTERRUPTS);
638
639 /* basic c_can configuration */ 636 /* basic c_can configuration */
640 c_can_chip_config(dev); 637 c_can_chip_config(dev);
641 638
@@ -643,6 +640,9 @@ static void c_can_start(struct net_device *dev)
643 640
644 /* reset tx helper pointers */ 641 /* reset tx helper pointers */
645 priv->tx_next = priv->tx_echo = 0; 642 priv->tx_next = priv->tx_echo = 0;
643
644 /* enable status change, error and module interrupts */
645 c_can_enable_all_interrupts(priv, ENABLE_ALL_INTERRUPTS);
646} 646}
647 647
648static void c_can_stop(struct net_device *dev) 648static void c_can_stop(struct net_device *dev)