From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.223 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796204556; b=Jp+0gnVJQ1OWwJYuyVypmPb6B/Ts0ZHL7iuUfh0bGHZZfoxRZE3AQ1BxYVJf/GzAsEfw fRSO2KxbvTbVJt8DAaTAcD9qTIcNRJjV7/TPT7KlOQTQLX3aPxJ/Aab0Bz4QGXHXjVJzz eVsYgFmmfQ+5Wsuk9q/GN40e7xnp59lAEn19tze9EgEKLLlMaJOtlFBx9iVoIvh+6QQ1f sYxVPW/M8D9Og0NvfCb2hf9tWsl/Qn4isv69OoPUSjqxAX20xo0H8QOAHfgLo4sZSjAUX rPLSbFPclbSRksOMcYMw/8EBlKRW34jGBKjMJrD3WeveMaT4NMDgqoE/173/CflrIDg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796204556; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=V0PTDUoGpHpzUKP8wNR2z2vTK+iNpqsCNB2tX3HOA0Y=; b=IlkKRGSDv5aop1Txkd9fJujGVQEa07BJmziPCCy3ALAbVV0sCY7jkZQRCi9fdDiWdOm4 h6GU0Lk3Y5hVmdhU0TO30IC56rYM8jhQjUfpPPO/xJrPt9r2BMsNg177ZpGKuoCbyQ/Zb 8XDztKpRcV9fjdtVGyoE+5AeET+gPp2HSgBCDpZobHbucCATzyiE9/i2piy3BCYy16Zxw uiYXo72PLrxlJtkezhop/L5iMr3CRgP2GbYiHswNmoECLR2NVZyOqbn9rx54z3LM5NJP2 fMduTKaN1cTgbDGPidoSIJMgn1Gk3xXlg1Fa+SwTqod1aYgm8f3WDHC+MBBZThEFS0Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=gqKafSqv; arc=none smtp.remote-ip=95.215.58.223 Received: from mta1.migadu.com (out-223.mta1.migadu.com [95.215.58.223]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF374606A32A for ; Wed, 2 Dec 2026 09:42:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BF374606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=gqKafSqv X-Envelope-To: devicetree@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=jtDQFgrS9zjW2GTkydB8CwUxVF1rRBudpZFBuhgIFmM=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796204552; v=1; x=1796809352; b=gqKafSqvokDOX7k0qpoeZD+yITkIBEoyR/PeKUMfeJ3774cpmAiBBvM0YLDJjV16nRS4ajoZ gvOo37ckIXIsbPv4ZWkvUwVix/Bp5JmqeNp+GYhF51nB6h2g7ibv3Mhg5XAgAoefYV7YzCX7QAI M0kX4A7CyAFgHfS542cjp9E4= X-Envelope-To: devicetree@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id d7797c1663e99bf7; Wed, 02 Dec 2026 09:42:32 +0000 X-Mizu-Trace-ID: d7797c1663e99bf7 X-Migadu-Flow: FLOW_OUT Message-ID: <39436a71-d7ed-4a69-8d07-f244f6c4dc2f@linux.dev> Date: Wed, 2 Dec 2026 10:42:29 +0100 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v6 12/15] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port To: Prabhakar , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Russell King , Willem de Bruijn , Simon Horman , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar References: <20261202093357.15693-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20261202093357.15693-13-prabhakar.mahadev-lad.rj@bp.renesas.com> Content-Language: en-US From: Clement Leger In-Reply-To: <20261202093357.15693-13-prabhakar.mahadev-lad.rj@bp.renesas.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/2/26 10:33, Prabhakar wrote: > From: Lad Prabhakar > > 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 > --- > 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 Thanks, Clément