]> git.baikalelectronics.ru Git - kernel.git/commit
can: c_can: Fix hardware raminit function
authorThomas Gleixner <tglx@linutronix.de>
Tue, 18 Mar 2014 17:19:08 +0000 (17:19 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 1 Apr 2014 09:54:57 +0000 (11:54 +0200)
commitc5e399e52b8eb1741ac56041fe664b23b01db9c7
treeafab304c5344009f73aa931cd1f4ec19382105d4
parentd00e47793096b35954dbf60304a71f6489b54f37
can: c_can: Fix hardware raminit function

The function is broken in several ways:

    - The function does not wait for the init to complete.
      That can take quite some microseconds.

    - No protection against being called for two chips at the same
      time. SMP is such a new thing, right?

Clear the start and the init done bit unconditionally and wait for both bits to
be clear.

In the enable path set the init bit and wait for the init done bit.

Add proper locking.

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