lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <TY3PR01MB1134632B48784F5D72721611D86C8A@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Date: Sun, 16 Nov 2025 10:31:14 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Marc Kleine-Budde <mkl@...gutronix.de>, Geert Uytterhoeven
	<geert+renesas@...der.be>
CC: Vincent Mailhol <mailhol@...nel.org>, Geert Uytterhoeven
	<geert+renesas@...der.be>, magnus.damm <magnus.damm@...il.com>, Tranh Ha
	<tranh.ha.xb@...esas.com>, Duy Nguyen <duy.nguyen.rh@...esas.com>,
	"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
	"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Prabhakar
 Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>,
	"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH] can: rcar_canfd: Fix controller mode setting for RZ/G2L
 SoCs

Hi All,

> -----Original Message-----
> From: Biju Das
> Sent: 15 November 2025 13:57
> Subject: RE: [PATCH] can: rcar_canfd: Fix controller mode setting for RZ/G2L SoCs
> 
> Hi Marc, Geert,
> 
> > -----Original Message-----
> > From: Marc Kleine-Budde <mkl@...gutronix.de>
> > Sent: 12 November 2025 08:47
> > Subject: Re: [PATCH] can: rcar_canfd: Fix controller mode setting for
> > RZ/G2L SoCs
> >
> > On 30.10.2025 12:05:04, Biju wrote:
> > > From: Biju Das <biju.das.jz@...renesas.com>
> > >
> > > The commit 5cff263606a1 ("can: rcar_canfd: Fix controller mode
> > > setting") applies to all SoCs except the RZ/G2L family of SoCs. As
> > > per RZ/G2L hardware manual "Figure 28.16 CAN Setting Procedure after
> > > the MCU is Reset" CAN mode needs to be set before channel reset. Add
> > > the mode_before_ch_rst variable to struct rcar_canfd_hw_info to
> > > handle this difference.
> > >
> > > The above commit also breaks CANFD functionality on RZ/G3E. Adapt
> > > this change to RZ/G3E, as well as it works ok by following the
> > > initialisation sequence of RZ/G2L.
> > >
> > > Fixes: 5cff263606a1 ("can: rcar_canfd: Fix controller mode setting")
> > > Cc: stable@...r.kernel.org
> > > Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
> >
> > Applied to linux-can.
> 
> There are 3 modes for CANFD on RZ/G3E
> 
> 1) CAN-FD mode
> 2) FD only mode
> 3) Classical CAN only mode
> 
> In the "FD only mode", the FDOE bit enables the reception and transmission of CAN-FD-only frames.
> If enabled, communication in the Classical CAN frame format is disabled.
> 
> On RZ/G2L, currently, CAN-FD mode is enabled by default and On RZ/G3E and R-Car Gen4, currently FD-
> only mode is the default.
> 
> Prior to commit 5cff263606a1010 ("can: rcar_canfd: Fix controller mode setting) RZ/G3E and R-Car Gen4
> are using incorrect code for setting CAN-FD mode. But fortunately, it sets the mode as CAN-FD node, as
> the channel reset was executed after setting the mode, that resets the registers to CAN-FD
> mode.(Global reset, set mode, channel reset)
> 
> The commit 5cff263606a1010 makes (Global reset, channel reset, set mode), now align with the flow
> mentioned in the hardware manual for all SoCs except RZ/G2L.
> But because of the earlier wrong code, it sets to FD-only mode instead of CAN-FD mode.
> 
> Is it okay to drop this patch so I can send another patch to make CAN-FD mode as the default for
> RZ/G3E and R-Car Gen4?
> 
> As an enhancement, we need to define a device tree property to support FD-only mode for RZ/G2L, RZ/G3E
> and R-Car Gen4. Please share your thoughts on this.


Just to add,

The patch I posted "can: rcar_canfd: Fix controller mode setting for RZ/G2L SoCs" and
commit 5cff263606a1010 ("can: rcar_canfd: Fix controller mode setting) is wrong for 
R-Car Gen3.

R-Car Gen3 has only 2 modes: CAN-FD and Classical CAN (there is no FD-only mode).
All other SoCs has 3 modes, CAN-FD, Classical CAN and FD-only mode

R-Can Gen3, RZ/G2L (CAN-FD and Classical modes): Modify the RSCFDnCFDGRMCFG register only in global reset mode.
(Here the flow is global reset, set mode, channel reset)

Selection of FD-only mode for RZ/G2L: Modify the FDOE bit in RSCFDnCFDCmFDCFG only in channel reset

RZ/G3E and R-Car Gen4: Modify the FDOE/CLOE bit in CFDCnFDCFG only in channel reset
                      (Here flow is global reset, set mode, channel reset)

Cheers,
Biju


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ