All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Prabhakar <prabhakar.csengg@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	wsa+renesas@sang-engineering.com
Subject: Re: [PATCH net-next v3 11/13] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port
Date: Thu, 15 Oct 2026 13:19:33 +0000	[thread overview]
Message-ID: <sashiko-outbox-172921@kernel.org> (raw)
In-Reply-To: <20261014131906.990077-12-prabhakar.mahadev-lad.rj@bp.renesas.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] net: dsa: missing NULL check for of_device_get_match_data()
--

commit 8d40702613d22f005a1af76ac95b3654ab3e2d50
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port

The ETHSW IP used in SoCs such as RZ/T2H and RZ/N2H has a hardware issue
where the internal mgmt_tag_vld signal is asserted as a level instead of
a single-cycle pulse. This causes the frame length counter on the
management (CPU) port to over-increment, so valid frames are falsely
detected as oversized and dropped.

> diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
> index 0b0b4055e6155..30eca64fb2183 100644
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -209,8 +209,13 @@ static int a5psw_port_enable(struct dsa_switch *ds, int port,
>  static int a5psw_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
>  {
>  	struct a5psw *a5psw = ds->priv;
> +	const struct a5psw_of_data *of_data = a5psw->of_data;
> +
> +	if (dsa_is_cpu_port(ds, port) && of_data->management_port_fixed_frame_len)
> +		return 0;

[Severity: Medium]
Since this code relies on a5psw->of_data, could there be a NULL pointer
dereference if the device is bound manually via sysfs without a matching
device tree node?

Looking at a5psw_probe() where a5psw->of_data is initialized:

	a5psw->of_data = of_device_get_match_data(dev);
	a5psw->bridged_ports = BIT(a5psw->of_data->cpu_port);

If a user with root privileges binds the driver via sysfs (using
driver_override and bind) without a matching device tree node,
of_device_get_match_data() returns NULL. Does this cause an immediate
crash when accessing cpu_port during probe?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261014131906.990077-1-prabhakar.mahadev-lad.rj@bp.renesas.com?part=11

  reply	other threads:[~2026-10-15 13:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 13:18 [PATCH net-next v3 00/13] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
2026-10-14 13:18 ` [PATCH net-next v3 01/13] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Prabhakar
2026-10-14 13:18 ` [PATCH net-next v3 02/13] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support Prabhakar
2026-10-14 13:18 ` [PATCH net-next v3 03/13] net: dsa: Kconfig: Expand config description to cover RZ/T2H and RZ/N2H ETHSW Prabhakar
2026-10-14 13:18 ` [PATCH net-next v3 04/13] dt-bindings: net: dsa: renesas,rzn1-a5psw: Disallow ports beyond port@4 Prabhakar
2026-10-15 13:19   ` sashiko-bot
2026-10-15 20:37     ` Rob Herring
2026-10-14 13:18 ` [PATCH net-next v3 05/13] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Prabhakar
2026-10-15 20:39   ` Rob Herring (Arm)
2026-10-14 13:18 ` [PATCH net-next v3 06/13] net: dsa: rzn1-a5psw: Add support for optional reset control Prabhakar
2026-10-14 13:18 ` [PATCH net-next v3 07/13] net: dsa: rzn1-a5psw: Add support for optional timestamp clock Prabhakar
2026-10-14 13:18 ` [PATCH net-next v3 08/13] net: dsa: rzn1-a5psw: Make use dev_err_probe() Prabhakar
2026-10-14 13:18 ` [PATCH net-next v3 09/13] net: dsa: rzn1-a5psw: Get switch info via OF data Prabhakar
2026-10-15 13:19   ` sashiko-bot
2026-10-14 13:18 ` [PATCH net-next v3 10/13] net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible string Prabhakar
2026-10-15 13:19   ` sashiko-bot
2026-10-14 13:18 ` [PATCH net-next v3 11/13] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
2026-10-15 13:19   ` sashiko-bot [this message]
2026-10-14 13:19 ` [PATCH net-next v3 12/13] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch Prabhakar
2026-10-15 13:19   ` sashiko-bot
2026-10-14 13:19 ` [PATCH net-next v3 13/13] net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs Prabhakar

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=sashiko-outbox-172921@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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.