Skip to content

Commit 5cff263

Browse files
Duy Nguyenmarckleinebudde
authored andcommitted
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: Duy Nguyen <[email protected]> Signed-off-by: Tranh Ha <[email protected]> Link: https://patch.msgid.link/TYWPR01MB87434739F83E27EDCD23DF44B416A@TYWPR01MB8743.jpnprd01.prod.outlook.com Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 6b69680 commit 5cff263

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/can/rcar/rcar_canfd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,6 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
823823
/* Reset Global error flags */
824824
rcar_canfd_write(gpriv->base, RCANFD_GERFL, 0x0);
825825

826-
/* Set the controller into appropriate mode */
827-
rcar_canfd_set_mode(gpriv);
828-
829826
/* Transition all Channels to reset mode */
830827
for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
831828
rcar_canfd_clear_bit(gpriv->base,
@@ -844,6 +841,10 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
844841
return err;
845842
}
846843
}
844+
845+
/* Set the controller into appropriate mode */
846+
rcar_canfd_set_mode(gpriv);
847+
847848
return 0;
848849
}
849850

0 commit comments

Comments
 (0)