From: Clement Leger <clement.leger@linux.dev>
To: Prabhakar <prabhakar.csengg@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>
Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org,
Prabhakar <prabhakar.csengg+renesas@gmail.com>,
Biju Das <biju.das.jz@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH net-next v6 12/15] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port
Date: Wed, 2 Dec 2026 10:42:29 +0100 [thread overview]
Message-ID: <39436a71-d7ed-4a69-8d07-f244f6c4dc2f@linux.dev> (raw)
In-Reply-To: <20261202093357.15693-13-prabhakar.mahadev-lad.rj@bp.renesas.com>
On 12/2/26 10:33, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> 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.
>
> The recommended workaround is to program the maximum frame length
> register (FRM_LENGTH) of the management port with a fixed, large value.
>
> Add a management_port_fixed_frame_len member to struct a5psw_of_data to
> hold the SoC-specific value. When it is set, program A5PSW_FRM_LENGTH
> for the CPU port with this value in a5psw_setup(), and skip updating
> FRM_LENGTH for the CPU port in a5psw_port_change_mtu() so that MTU
> changes do not override the workaround.
>
> No functional change for existing SoCs, which leave the value unset.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> v6:
> - No change
> v5: https://lore.kernel.org/all/20261120002549.1908299-18-prabhakar.mahadev-lad.rj@bp.renesas.com/
> - No change
> v4: https://lore.kernel.org/all/20261104182105.1102555-13-prabhakar.mahadev-lad.rj@bp.renesas.com/
> - No change
> v3: https://lore.kernel.org/all/20261014131906.990077-12-prabhakar.mahadev-lad.rj@bp.renesas.com/
> - Marked of_data as const pointer to avoid build warning
> v2: https://lore.kernel.org/all/20261001154326.754314-11-prabhakar.mahadev-lad.rj@bp.renesas.com/
> - Added info about the IP issue and the workaround.
> - Updated commit message
> v1: https://lore.kernel.org/all/20251121113553.2955854-10-prabhakar.mahadev-lad.rj@bp.renesas.com/
> ---
> drivers/net/dsa/rzn1_a5psw.c | 17 ++++++++++++++++-
> drivers/net/dsa/rzn1_a5psw.h | 3 +++
> 2 files changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
> index a768b0545e02..05753538c5ed 100644
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -217,6 +217,10 @@ 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;
>
> new_mtu += ETH_HLEN + A5PSW_EXTRA_MTU_LEN + ETH_FCS_LEN;
> a5psw_reg_writel(a5psw, A5PSW_FRM_LENGTH(port), new_mtu);
> @@ -993,8 +997,19 @@ static int a5psw_setup(struct dsa_switch *ds)
> if (dsa_port_is_unused(dp))
> continue;
>
> - /* Enable egress flooding and learning for CPU port */
> if (dsa_port_is_cpu(dp)) {
> + /*
> + * Workaround for ETHSW IP issue, mgmt_tag_vld is asserted as a level
> + * instead of a single-cycle pulse, causing the frame length counter
> + * to over-increment and trigger false oversize frame drops.
> + * The recommended workaround is to set the maximum frame
> + * length on the management port.
> + */
> + if (a5psw->of_data->management_port_fixed_frame_len)
> + a5psw_reg_writel(a5psw, A5PSW_FRM_LENGTH(port),
> + a5psw->of_data->management_port_fixed_frame_len);
> +
> + /* Enable egress flooding and learning for CPU port */
> a5psw_flooding_set_resolution(a5psw, port, true);
> a5psw_port_learning_set(a5psw, port, true);
> }
> diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h
> index 58690f5f3887..942931cbc402 100644
> --- a/drivers/net/dsa/rzn1_a5psw.h
> +++ b/drivers/net/dsa/rzn1_a5psw.h
> @@ -237,12 +237,15 @@ union lk_data {
> * @npcs: Number of PCS connected to the switch
> * @cpu_port: CPU port number
> * @tag_proto: DSA tag protocol used by the switch
> + * @management_port_fixed_frame_len: Fixed frame length for the management
> + * port to account for the HW issue.
> */
> struct a5psw_of_data {
> unsigned int nports;
> unsigned int npcs;
> unsigned int cpu_port;
> enum dsa_tag_protocol tag_proto;
> + unsigned int management_port_fixed_frame_len;
> };
>
> /**
LGTM,
Reviewed-by: Clément Léger <clement.leger@linux.dev>
Thanks,
Clément
next prev parent reply other threads:[~2026-12-02 9:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 9:33 [PATCH net-next v6 00/15] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 01/15] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 02/15] net: dsa: tag_rzn1_a5psw: Fix RZ/N1 tagger module alias Prabhakar
2026-12-02 9:39 ` Clement Leger
2026-12-02 9:33 ` [PATCH net-next v6 03/15] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 04/15] net: pcs: rzn1-miic: Select ETHSW port speed through SWCTRL Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 05/15] dt-bindings: net: dsa: renesas,rzn1-a5psw: Reject the "ports" node Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 06/15] dt-bindings: net: dsa: renesas,rzn1-a5psw: Limit port reg values Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 07/15] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 08/15] net: dsa: rzn1-a5psw: Add support for optional reset control Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 09/15] net: dsa: rzn1-a5psw: Add support for optional timestamp clock Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 10/15] net: dsa: rzn1-a5psw: Make use dev_err_probe() Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 11/15] net: dsa: rzn1-a5psw: Get switch configuration from OF data Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 12/15] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
2026-12-02 9:42 ` Clement Leger [this message]
2026-12-02 9:33 ` [PATCH net-next v6 13/15] net: dsa: rzn1-a5psw: Get register layout from OF data Prabhakar
2026-12-02 9:37 ` Clement Leger
2026-12-02 9:33 ` [PATCH net-next v6 14/15] net: dsa: rzn1-a5psw: Keep MAC TX enabled on RZ/T2H Prabhakar
2026-12-02 9:33 ` [PATCH net-next v6 15/15] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch Prabhakar
2026-12-02 9:38 ` Clement Leger
2026-12-02 9:40 ` [PATCH net-next v6 00/15] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs netdev-bot+sinfo
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=39436a71-d7ed-4a69-8d07-f244f6c4dc2f@linux.dev \
--to=clement.leger@linux.dev \
--cc=andrew@lunn.ch \
--cc=biju.das.jz@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=prabhakar.csengg+renesas@gmail.com \
--cc=prabhakar.csengg@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@kernel.org \
--cc=willemb@google.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.