]> git.baikalelectronics.ru Git - kernel.git/commit
can: flexcan: fix transition from and to freeze mode in chip_{,un}freeze
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 28 Feb 2014 16:08:21 +0000 (17:08 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 3 Mar 2014 11:41:46 +0000 (12:41 +0100)
commitf6d35d0ff0c6fb3b23b7539eaff036d24315c2af
tree88e163d51f28e04dbdca2b931b3bc76c0497af6f
parente140fce725fa015c982c47db346262323d85ef35
can: flexcan: fix transition from and to freeze mode in chip_{,un}freeze

This patch factors out freeze and unfreeze of the CAN core into seperate
functions. Experiments have shown that the transition from and to freeze mode
may take several microseconds, especially the time entering the freeze mode
depends on the current bitrate.

This patch adds a while loop which polls the Freeze Mode ACK bit (FRZ_ACK) that
indicates a successfull mode change. If the function runs into a timeout a
error value is returned.

Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c