]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
can: rcar_canfd: Fix CAN-FD mode as default
authorBiju Das <biju.das.jz@bp.renesas.com>
Tue, 18 Nov 2025 12:39:25 +0000 (12:39 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 26 Nov 2025 15:26:41 +0000 (16:26 +0100)
commit6d849ff573722afcf5508d2800017bdd40f27eb9
tree64fadf45c9a8debfb65bffb811ae9cc73cd45075
parent76544beea7cfe5bcce6d60f53811657b88ec8be1
can: rcar_canfd: Fix CAN-FD mode as default

The commit 5cff263606a1 ("can: rcar_canfd: Fix controller mode setting")
has aligned with the flow mentioned in the hardware manual for all SoCs
except R-Car Gen3 and RZ/G2L SoCs. On R-Car Gen4 and RZ/G3E SoCs, due to
the wrong logic in the commit[1] sets the default mode to FD-Only mode
instead of CAN-FD mode.

This patch sets the CAN-FD mode as the default for all SoCs by dropping
the rcar_canfd_set_mode() as some SoC requires mode setting in global
reset mode, and the rest of the SoCs in channel reset mode and update the
rcar_canfd_reset_controller() to take care of these constraints. Moreover,
the RZ/G3E and R-Car Gen4 SoCs support 3 modes compared to 2 modes on the
R-Car Gen3. Use inverted logic in rcar_canfd_reset_controller() to
simplify the code later to support FD-only mode.

[1]
commit 45721c406dcf ("can: rcar_canfd: Add support for r8a779a0 SoC")

Fixes: 5cff263606a1 ("can: rcar_canfd: Fix controller mode setting")
Cc: stable@vger.kernel.org
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20251118123926.193445-1-biju.das.jz@bp.renesas.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/rcar/rcar_canfd.c