aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorAnilKumar Ch <anilkumar@ti.com>2012-05-23 08:15:11 -0400
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-06-03 12:59:20 -0400
commitf461f27a4436dbe691908fe08b867ef888848cc3 (patch)
tree2d1d433868d33b6ec59e3685245adc197384f365 /drivers/net/can
parent148c87c89e1a8863d3d965179f3ab1a06490569e (diff)
can: c_can: fix race condition in c_can_open()
Fix the issue of C_CAN interrupts getting disabled forever when canconfig utility is used multiple times. According to NAPI usage we disable all the hardware interrupts in ISR and re-enable them in poll(). Current implementation calls napi_enable() after hardware interrupts are enabled. If we get any interrupts between these two steps then we do not process those interrupts because napi is not enabled. Mostly these interrupts come because of STATUS is not 0x7 or ERROR interrupts. If napi_enable() happens before HW interrupts enabled then c_can_poll() function will be called eventual re-enabling. This patch moves the napi_enable() call before interrupts enabled. Cc: stable@kernel.org # 2.6.39+ Signed-off-by: AnilKumar Ch <anilkumar@ti.com> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/c_can/c_can.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index fa016214c52f..8dc84d66eea1 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -1064,10 +1064,11 @@ static int c_can_open(struct net_device *dev)
1064 goto exit_irq_fail; 1064 goto exit_irq_fail;
1065 } 1065 }
1066 1066
1067 napi_enable(&priv->napi);
1068
1067 /* start the c_can controller */ 1069 /* start the c_can controller */
1068 c_can_start(dev); 1070 c_can_start(dev);
1069 1071
1070 napi_enable(&priv->napi);
1071 netif_start_queue(dev); 1072 netif_start_queue(dev);
1072 1073
1073 return 0; 1074 return 0;