]> www.infradead.org Git - nvme.git/commit
can: m_can: don't enable transceiver when probing
authorMartin Hundebøll <martin@geanix.com>
Fri, 7 Jun 2024 10:52:08 +0000 (12:52 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 21 Jun 2024 07:47:24 +0000 (09:47 +0200)
commitcd5a46ce6fa62abedd7740e4bd9f3d82041210ee
tree306e4946b97d0cd5ac8a33e0bd84b9a9e333f494
parent3da74c5145dc729e06e2fb950b4aa196f83bf65f
can: m_can: don't enable transceiver when probing

The m_can driver sets and clears the CCCR.INIT bit during probe (both
when testing the NON-ISO bit, and when configuring the chip). After
clearing the CCCR.INIT bit, the transceiver enters normal mode, where it
affects the CAN bus (i.e. it ACKs frames). This can cause troubles when
the m_can node is only used for monitoring the bus, as one cannot setup
listen-only mode before the device is probed.

Rework the probe flow, so that the CCCR.INIT bit is only cleared when
upping the device. First, the tcan4x5x driver is changed to stay in
standby mode during/after probe. This in turn requires changes when
setting bits in the CCCR register, as its CSR and CSA bits are always
high in standby mode.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Tested-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/all/20240607105210.155435-1-martin@geanix.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can.c
drivers/net/can/m_can/tcan4x5x-core.c