From: sashiko-bot@kernel.org
To: "Claudiu Beznea" <claudiu.beznea+renesas@tuxon.dev>
Cc: devicetree@vger.kernel.org,
"Oliver Hartkopp" <socketcan@hartkopp.net>,
"Oleksij Rempel" <o.rempel@pengutronix.de>,
linux-can@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
wsa+renesas@sang-engineering.com,
"Marc Kleine-Budde" <mkl@pengutronix.de>,
"Vincent Mailhol" <mailhol@kernel.org>
Subject: Re: [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode
Date: Tue, 07 Jul 2026 10:53:44 +0000 [thread overview]
Message-ID: <20260707105344.EA5DD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260707102418.1646159-6-claudiu.beznea+renesas@tuxon.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch adds the `mode_select_na` flag to support the RZ/G3S SoC, but fails to provide the RZ/G3S hardware info structure with the flag set, rendering the logic as dead code.
--
--- Patch [5]: [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode ---
commit c89aa117ce922f6dfb13d5f51bb4146e8af1be2c
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
can: rcar_canfd: Do not set registers selecting the CAN mode
This patch adds the mode_select_na flag to struct rcar_canfd_hw_info to avoid
writing to unavailable CAN mode bits on the Renesas RZ/G3S SoC. The flag is
initialized to 0 for existing hardware structures, and a conditional check
is added in the controller reset path to skip mode selection if the flag is
set.
Link: https://lore.kernel.org/all/1d9719e3-10ff-4cd8-b729-55fea93c37ce@wanadoo.fr
> diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
> index 6ec2d7a031238..7f01afe60a4c2 100644
> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c
> @@ -445,6 +445,7 @@ struct rcar_canfd_hw_info {
> unsigned shared_can_regs:1; /* Has shared classical can registers */
> unsigned external_clk:1; /* Has external clock */
> unsigned fcan_pclk:1; /* Has fcan sourced from pclk. */
> + unsigned mode_select_na:1; /* Has no bits for selecting the mode. */
> };
>
> /* Channel priv data */
[Severity: Medium]
Was the RZ/G3S hardware info structure missing from this patch series?
The commit message mentions adding this flag to cover the RZ/G3S SoC, but
all existing structures are updated to set this flag to 0, and no new
structure is added that sets it to 1.
[ ... ]
> @@ -846,6 +852,9 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
> }
>
> /* Set the controller into appropriate mode */
> + if (gpriv->info->mode_select_na)
> + continue;
> +
> if (gpriv->info->ch_interface_mode) {
> /* Do not set CLOE and FDOE simultaneously */
> if (!gpriv->fdmode) {
[Severity: Medium]
Since mode_select_na is never set to 1 anywhere in the driver, doesn't this
conditional evaluate to false for all devices, resulting in dead code?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707102418.1646159-1-claudiu.beznea+renesas@tuxon.dev?part=5
next prev parent reply other threads:[~2026-07-07 10:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
2026-07-07 10:24 ` [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD Claudiu Beznea
2026-07-07 10:34 ` sashiko-bot
2026-07-09 15:45 ` Geert Uytterhoeven
2026-07-07 10:24 ` [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC Claudiu Beznea
2026-07-07 10:30 ` sashiko-bot
2026-07-07 16:15 ` Conor Dooley
2026-07-07 16:16 ` Conor Dooley
2026-07-07 10:24 ` [PATCH 3/8] can: rcar_canfd: Fix typos in macro names Claudiu Beznea
2026-07-07 10:24 ` [PATCH 4/8] can: rcar_canfd: Allow the CAN FD clock to be sourced from fck Claudiu Beznea
2026-07-07 10:33 ` sashiko-bot
2026-07-07 10:24 ` [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode Claudiu Beznea
2026-07-07 10:53 ` sashiko-bot [this message]
2026-07-07 10:24 ` [PATCH 6/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
2026-07-07 10:49 ` sashiko-bot
2026-07-07 10:24 ` [PATCH 7/8] arm64: dts: renesas: r9a08g045: Add CAN-FD node Claudiu Beznea
2026-07-07 10:24 ` [PATCH 8/8] arm64: dts: renesas: rzg3s-smarc: Enable CAN-FD Claudiu Beznea
2026-07-07 10:31 ` [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Biju Das
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260707105344.EA5DD1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=claudiu.beznea+renesas@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
--cc=o.rempel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=socketcan@hartkopp.net \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.