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: <CAMuHMdUhR1PgfY28uVCN6hQjO9sMRJFiTEUAnAqPX+px6Wp1QQ@mail.gmail.com>
Date: Mon, 1 Sep 2025 15:16:26 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Biju <biju.das.au@...il.com>
Cc: Marc Kleine-Budde <mkl@...gutronix.de>, Vincent Mailhol <mailhol.vincent@...adoo.fr>, 
	Magnus Damm <magnus.damm@...il.com>, Biju Das <biju.das.jz@...renesas.com>, 
	linux-can@...r.kernel.org, linux-renesas-soc@...r.kernel.org, 
	linux-kernel@...r.kernel.org, 
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>, 
	Fabrizio Castro <fabrizio.castro.jz@...esas.com>
Subject: Re: [PATCH v2 1/4] can: rcar_canfd: Add shared_bittiming variable to
 struct rcar_canfd_hw_info

Hi Biju,

On Thu, 21 Aug 2025 at 16:14, Biju <biju.das.au@...il.com> wrote:
> From: Biju Das <biju.das.jz@...renesas.com>
>
> The calculation formula for nominal bit rate of classical CAN is same as
> that of nominal bit rate of CANFD on the RZ/G3E SoC compared to other SoCs.
> Add shared_bittiming variable to struct rcar_canfd_hw_info to handle this
> difference.
>
> Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
> Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@...esas.com>

Thanks for your patch!

> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c
> @@ -461,6 +461,7 @@ struct rcar_canfd_hw_info {
>         unsigned ch_interface_mode:1;   /* Has channel interface mode */
>         unsigned shared_can_regs:1;     /* Has shared classical can registers */
>         unsigned external_clk:1;        /* Has external clock */
> +       unsigned shared_bittiming:1;    /* Has shared nominal bittiming constants */
>  };
>
>  /* Channel priv data */
> @@ -632,6 +633,7 @@ static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
>         .ch_interface_mode = 0,
>         .shared_can_regs = 0,
>         .external_clk = 1,
> +       .shared_bittiming = 0,
>  };
>
>  static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
> @@ -649,6 +651,7 @@ static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
>         .ch_interface_mode = 1,
>         .shared_can_regs = 1,
>         .external_clk = 1,
> +       .shared_bittiming = 0,

I could find no stricter limitation of the bit timings in classical
CAN mode on R-Car Gen4, so it looks like this should be 1, too...

>  };
>
>  static const struct rcar_canfd_hw_info rzg2l_hw_info = {
> @@ -666,6 +669,7 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
>         .ch_interface_mode = 0,
>         .shared_can_regs = 0,
>         .external_clk = 1,
> +       .shared_bittiming = 0,
>  };
>
>  static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
> @@ -683,6 +687,7 @@ static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
>         .ch_interface_mode = 1,
>         .shared_can_regs = 1,
>         .external_clk = 0,
> +       .shared_bittiming = 1,
>  };
>
>  /* Helper functions */
> @@ -1912,7 +1917,10 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
>                 priv->can.fd.do_get_auto_tdcv = rcar_canfd_get_auto_tdcv;
>         } else {
>                 /* Controller starts in Classical CAN only mode */
> -               priv->can.bittiming_const = &rcar_canfd_bittiming_const;
> +               if (gpriv->info->shared_bittiming)

... hence you can just check the existing shared_can_regs flag here,
and don't need to introduce a new flag for shared bittimings?

> +                       priv->can.bittiming_const = gpriv->info->nom_bittiming;
> +               else
> +                       priv->can.bittiming_const = &rcar_canfd_bittiming_const;
>                 priv->can.ctrlmode_supported = CAN_CTRLMODE_BERR_REPORTING;
>         }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ