]> git.baikalelectronics.ru Git - kernel.git/commit
can: c_can: fix race condition in c_can_open()
authorAnilKumar Ch <anilkumar@ti.com>
Wed, 23 May 2012 12:15:11 +0000 (17:45 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 3 Jun 2012 16:59:20 +0000 (18:59 +0200)
commit100314e38cd55394a5a88e4fce681b3011184fad
tree2d1d433868d33b6ec59e3685245adc197384f365
parentb63a2c362a02cd3b24f3d3523f745a56d9ff22f7
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>
drivers/net/can/c_can/c_can.c