can: c_can: D_CAN: c_can_chip_config(): perform a sofware reset on open
authorJeroen Hofstee <jhofstee@victronenergy.com>
Tue, 1 Oct 2019 21:01:20 +0000 (21:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:36:58 +0000 (15:36 +0100)
commitb448e73cd2cf2ec5bdab5ed8a322c000dc5fea8f
tree3e937b82515121905b54f8553b98936d12739ac7
parenta07253754ad72d0d4cf64dfcbff66da7bf1cd74c
can: c_can: D_CAN: c_can_chip_config(): perform a sofware reset on open

[ Upstream commit 23c5a9488f076bab336177cd1d1a366bd8ddf087 ]

When the CAN interface is closed it the hardwre is put in power down
mode, but does not reset the error counters / state. Reset the D_CAN on
open, so the reported state and the actual state match.

According to [1], the C_CAN module doesn't have the software reset.

[1] http://www.bosch-semiconductors.com/media/ip_modules/pdf_2/c_can_fd8/users_manual_c_can_fd8_r210_1.pdf

Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/c_can/c_can.c