Commit 5cff2636 authored by Duy Nguyen's avatar Duy Nguyen Committed by Marc Kleine-Budde
Browse files

can: rcar_canfd: Fix controller mode setting



Driver configures register to choose controller mode before
setting all channels to reset mode leading to failure.
The patch corrects operation of mode setting.

Signed-off-by: default avatarDuy Nguyen <duy.nguyen.rh@renesas.com>
Signed-off-by: default avatarTranh Ha <tranh.ha.xb@renesas.com>
Link: https://patch.msgid.link/TYWPR01MB87434739F83E27EDCD23DF44B416A@TYWPR01MB8743.jpnprd01.prod.outlook.com


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 6b696808
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -823,9 +823,6 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
	/* Reset Global error flags */
	rcar_canfd_write(gpriv->base, RCANFD_GERFL, 0x0);

	/* Set the controller into appropriate mode */
	rcar_canfd_set_mode(gpriv);

	/* Transition all Channels to reset mode */
	for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
		rcar_canfd_clear_bit(gpriv->base,
@@ -844,6 +841,10 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
			return err;
		}
	}

	/* Set the controller into appropriate mode */
	rcar_canfd_set_mode(gpriv);

	return 0;
}