Article View: linux.kernel.netdev
Article #2009Re: [PATCH net-next v3 3/9] net: dsa: realtek: rtl8365mb: set speed for family D
From: netdev-bot+sashiko
Date: Sun, 11 Oct 2026 19:51
Date: Sun, 11 Oct 2026 19:51
116 lines
9898 bytes
9898 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message does not describe what the patch changes for
family D.
- [Low] Concern: no rtl8365mb_chip_infos[] entry sets .family =
RTL8365MB_FAMILY_D, so the new family D branch inβ¦
--
net: dsa: realtek: rtl8365mb: set speed for family D
This adds family D handling to rtl8365mb_ext_config_forcemode(). Family D
gets a dedicated 2500M speed value (5), and the third speed bit goes into
a new FORCE_SPEED2 field. Family D also programs a per-port force register
and a matching per-port enable register instead of the per-extint force
register.
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 840db5ad32efe..8f3295c232362 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
[ ... ]
> @@ -1692,20 +1717,44 @@ static int rtl8365mb_ext_config_forcemode(struct realtek_priv *priv, int port,
> r_duplex = 0;
> }
>
> - val = FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_EN_MASK, 1) |
> - FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_TXPAUSE_MASK,
> + val = FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_TXPAUSE_MASK,
> r_tx_pause) |
> FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_RXPAUSE_MASK,
> r_rx_pause) |
> FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_LINK_MASK, r_link) |
> FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_DUPLEX_MASK,
> r_duplex) |
> - FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_MASK, r_speed);
> - ret = regmap_write(priv->map,
> - RTL8365MB_DIGITAL_INTERFACE_FORCE_REG(extint->id),
> - val);
> - if (ret)
> - return ret;
> + FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_MASK,
> + r_speed &
> + RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_MASK);
> +
> + if (is_d) {
> + /* Speed is 3 bits on family D: bits[1:0] go into FORCE_SPEED,
> + * bit[2] goes into FORCE_SPEED2 (bit 12); only 2500M sets it,
> + * bit 13 of the field is unused.
> + */
> + val |= FIELD_PREP(RTL8365MB_D_DIGITAL_INTERFACE_FORCE_SPEED2_MASK,
> + r_speed >>
> + RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_WIDTH);
> + ret = regmap_write(priv->map,
> + RTL8365MB_D_DIGITAL_INTERFACE_FORCE_REG(port),
> + val);
> + if (ret)
> + return ret;
> +
> + ret = regmap_write(priv->map,
> + RTL8365MB_D_DIGITAL_INTERFACE_FORCE_REG_EN(port),
> + RTL8365MB_D_DIGITAL_INTERFACE_FORCE_EN_ALL_MASK);
> + if (ret)
> + return ret;
[Severity: Low]
This isn't a bug, but the subject and commit message only cover the new
3-bit speed encoding. For family D, rtl8365mb_ext_config_forcemode() also
changes these things:
- All forced-mode programming moves from
RTL8365MB_DIGITAL_INTERFACE_FORCE_REG(extint->id) to the per-port
register at 0x12c0 + port. That covers link, duplex, pause and every
speed, plus the link down path from mac_link_down.
- FORCE_EN (BIT(12)) is no longer set, because on family D that bit is
FORCE_SPEED2.
- Every call, including link down, writes 0xFFFF to a second per-port
register at 0x12c8 + port.
Could the commit message, or a comment here, explain what the 16 bits in
RTL8365MB_D_DIGITAL_INTERFACE_FORCE_REG_EN() select, and why setting all
of them is correct?
If those bits choose which fields of the force register are forced, then
0xFFFF also forces fields this code writes as zero (bit 7, bits 8-11 and
bits 14-15).
It might also help to say that the family C bit positions for TXPAUSE,
RXPAUSE, LINK, DUPLEX and SPEED are reused for the register at the new
address.
This looks like it follows the vendor RTL8367D sequence. The later patches
in the series leave this code as it is and don't add an explanation.
> + } else {
> + val |= FIELD_PREP(RTL8365MB_DIGITAL_INTERFACE_FORCE_EN_MASK, 1);
> + ret = regmap_write(priv->map,
> + RTL8365MB_DIGITAL_INTERFACE_FORCE_REG(extint->id),
> + val);
> + if (ret)
> + return ret;
> + }
[ ... ]
--
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/e84d76ee-03df-49b0-8c9a-b289dfae8728%40yahoo.com
Technical Details
Message-ID:
<179174828259.434549.11978481481032139705@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344595-linux-kernel-netdev=dewy.ruReferences:
<d9773155-5e61-4b6e-b892-73668ca61fc8@yahoo.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344595-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 3/9] net: dsa: realtek: rtl8365mb: set speed for family D Date: Sun, 11 Oct 2026 19:51:22 +0000 Organization: Usenet Network Message-ID: <179174828259.434549.11978481481032139705@kernel.org> References: <d9773155-5e61-4b6e-b892-73668ca61fc8@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1607296"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ruxWwzzd0qi0X6LbL5Odp3Y+an0= sha256:lwT2TaMYtRWGE8h2wSx2S4PiLWWGjWhUtkL3eUm7O7k= sha1:5uCccDayLInyVerJsvA/m0V7zzY= sha256:kJngzFM53v04i9zC1ye06PW9RJuzOaK53oV9ciDTAtI= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id EC49D10FA60; Sun, 11 Oct 2026 22:52:28 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.34 X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JtfYwko2R6mQ; Sun, 11 Oct 2026 22:52:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-344595-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 163CD10FA5B; Sun, 11 Oct 2026 22:52:22 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 971BF2FCF8; Sun, 11 Oct 2026 19:51:27 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77F7845D908; Sun, 11 Oct 2026 19:51:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Nhd92cc0" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55DAA45DF47; Sun, 11 Oct 2026 19:51:24 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791748286; cv=none; b=e6kPVT/MdTaXSbk7Ou57Kfwmbhx7RfC3CgetIIDktl7iAIBnLSe/z7pJkfzxpVepNMAOcnB7cHfFYroSif3P1pUvrWyuMgtHgHfIz85+q3UFKI7s+YnmyL+YkUQLrau/1kF+i1JUkTOu8lDXvVPHvz+5Pdylu8C7ikv14TxMvFU= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791748286; c=relaxed/simple; bh=ltjvSlIZvpHbEWDpeGHTQjUP9B1qiDlLlTMr7aeKuJM=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=azqO/Gr4cPqwZvVwNj9+W4gBaSzuQ+08qHb1m1xY8bl/Io7IcGY5wROyqLMDefpvCt/K7sZzAgG4JLGDypdx2JlObl1jrkwPtZYXW4vx8/irpTsZKmigXSNSpqZtsKz3qCMe9FlP3gFgzK5uT0Dg3duuLLBoKlKKq1QYAgNZL0E= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Nhd92cc0; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A02D1F0089C; Sun, 11 Oct 2026 19:51:22 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791748283; bh=Pjwebu0taw7+Pf1g8RYb3XqdPugV66LNzKHIwwXtLlE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Nhd92cc0oIqgRKqh7v9YNPrm1X47+PMPCrt6lxn6T+gOcr8B92yVmHpokPVOwoM+L wmOg/cWDtdHyHj5ZEE4X4XBoFwMjEOT8BsD7a0JAqj0EoqvU7eglb0oWw9erkR1ugj P59RhC+r1AdB7SRQFc4/eR+j2nKKKuLFHYKhd8B01jEVaOjQvafcaN2XCpmVCkK1XZ EwsTYMzgnv8tko6VQq7Sl3SCsKj0efyywhnAFe4norIlicZQuZpZ10Ch+Bfs3YhKow WU7+tOE541lG4Msk6GP8ByoUgef4TYOyODIQttAb/QLwTfO0eFWDcMTeDMsi6UGkn9 /JT9bzyuqpU2w== X-Cc: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com, kuba@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk, luizluca@gmail.com, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <d9773155-5e61-4b6e-b892-73668ca61fc8@yahoo.com> X-sashiko-severity: Low X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>