]> git.baikalelectronics.ru Git - kernel.git/commit
can: c_can: Make it SMP safe
authorThomas Gleixner <tglx@linutronix.de>
Tue, 18 Mar 2014 17:19:09 +0000 (17:19 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 1 Apr 2014 09:54:58 +0000 (11:54 +0200)
commit3472cb675efb6fbb05b2d5569e28bd742bbea7c2
treea2cc8b9df2cec515c2bb8f958d715cbd43cbb671
parenta8a240166e2b62cb379c6af5aac4a732df096d1c
can: c_can: Make it SMP safe

The hardware has two message control interfaces, but the code only uses the
first one. So on SMP the following can be observed:

CPU0          CPU1
rx_poll()
  write IF1 xmit()
write IF1
  write IF1

That results in corrupted message object configurations. The TX/RX is not
globally serialized it's only serialized on a core.

Simple solution: Let RX use IF1 and TX use IF2 and all is good.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can.c