]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: m_can: set init flag earlier in probe
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Mon, 7 Oct 2024 08:23:58 +0000 (10:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:05 +0000 (14:02 +0100)
commit3a3696ec46cffbdd9eabfbc069e4d9b6f4231057
tree2c0deee10461684b511cf6672eae3a2b1d1aca4b
parent5c553262f063b3bf85df3b22a9818a8d92510f4d
can: m_can: set init flag earlier in probe

[ Upstream commit fca2977629f49dee437e217c3fc423b6e0cad98c ]

While an m_can controller usually already has the init flag from a
hardware reset, no such reset happens on the integrated m_can_pci of the
Intel Elkhart Lake. If the CAN controller is found in an active state,
m_can_dev_setup() would fail because m_can_niso_supported() calls
m_can_cccr_update_bits(), which refuses to modify any other configuration
bits when CCCR_INIT is not set.

To avoid this issue, set CCCR_INIT before attempting to modify any other
configuration flags.

Fixes: cd5a46ce6fa6 ("can: m_can: don't enable transceiver when probing")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://patch.msgid.link/e247f331cb72829fcbdfda74f31a59cbad1a6006.1728288535.git.matthias.schiffer@ew.tq-group.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/m_can/m_can.c