mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: namiltd@yahoo.com
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
Subject: Re: [PATCH net-next v4 4/9] net: dsa: realtek: rtl8365mb: set RGMII mode for family D
Date: Tue, 13 Oct 2026 01:08:29 +0000	[thread overview]
Message-ID: <179185370913.434549.1834502511257239861@kernel.org> (raw)
In-Reply-To: <a79f1f46-625a-4aaf-931c-65737f8552fa@yahoo.com>

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] On family D, rtl8365mb_ext_config_rgmii()
  (drivers/net/dsa/realtek/rtl8365mb_main.c) reads TOP_CON0 for extint…

--

net: dsa: realtek: rtl8365mb: set RGMII mode for family D

For family D chips using RGMII on extension interface 1, this patch
clears the EXT1 RGMII TX clock delay field in EXT_TXC_DLY. If MAC4 is
not occupying extension 1, it also binds the RGMII/MII pins to MAC7 in
TOP_CON0. SerDes 1, which shares the pins, is always disabled.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 2dabc4da861f4..996ba2e39302c 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -1270,6 +1291,35 @@ static int rtl8365mb_ext_config_rgmii(struct realtek_priv *priv, int port,
>  	if (ret)
>  		return ret;
>  
> +	if (rtl8365mb_get_family(priv) == RTL8365MB_FAMILY_D &&
> +	    extint->id == 1) {
> +		ret = regmap_update_bits(priv->map,
> +					 RTL8365MB_D_REG_EXT_TXC_DLY,
> +					 RTL8365MB_D_EXT1_RGMII_TX_DLY_MASK, 0);
> +		if (ret)
> +			return ret;
> +		/* Configure RGMII/MII mux to port 7 if UTP_PORT4 is not in
> +		 * RGMII mode
> +		 */
> +		ret = regmap_read(priv->map, RTL8365MB_D_REG_TOP_CON0, &data);
> +		if (ret)
> +			return ret;
> +		if ((data & RTL8365MB_D_MAC4_SEL_EXT1_MASK) == 0) {
> +			ret = regmap_update_bits(priv->map,
> +						 RTL8365MB_D_REG_TOP_CON0,
> +						 RTL8365MB_D_MAC7_SEL_EXT1_MASK,
> +						 RTL8365MB_D_MAC7_SEL_EXT1_MASK);
> +			if (ret)
> +				return ret;
> +		}

[Severity: Low]
What happens in rtl8365mb_ext_config_rgmii() when strap or EEPROM has
already set RTL8365MB_D_MAC4_SEL_EXT1_MASK in TOP_CON0? In that case MAC4
owns the EXT1 pins, so MAC7_SEL_EXT1 is not set. The function still runs
the SDS1_MISC0 write below and returns 0.

By the time this check runs, these EXT1 registers have already been
changed for port 7:

    RTL8365MB_EXT_RGMXF_REG(extint->id) TX/RX delays from port 7's DT
    RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(extint->id) set to RGMII
    RTL8365MB_D_REG_EXT_TXC_DLY bits [5:3] cleared

If the pins belong to MAC4, could these writes change the RGMII timing
that the MAC4 path depends on?

The only caller, rtl8365mb_phylink_mac_config(), logs a message only on a
non-zero return:

    ret = rtl8365mb_ext_config_rgmii(priv, port, state->interface);
    if (ret)
        dev_err(priv->dev,
            "failed to configure RGMII mode on port %d: %pe\n",
            port, ERR_PTR(ret));

So when the DT describes port 7 as RGMII but the strap gives EXT1 to
MAC4, port 7 appears to be configured but carries no traffic, and
nothing is logged.

Since the code already detects this state, would it be better to return
an error such as -EBUSY before touching the shared EXT1 registers, or at
least print a warning?

> +		ret = regmap_update_bits(priv->map,
> +					 RTL8365MB_D_REG_SDS1_MISC0,
> +					 RTL8365MB_D_SDS_MISC_MODE_FIELD_MASK,
> +					 RTL8365MB_D_PORT_SDS_MODE_DISABLE);
> +		if (ret)
> +			return ret;
> +	}
> +
>  	return 0;
>  }

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/38872e6f-1264-4a93-9f81-8212173e909d%40yahoo.com

  reply	other threads:[~2026-10-13  1:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38872e6f-1264-4a93-9f81-8212173e909d.ref@yahoo.com>
2026-10-12  0:08 ` [PATCH net-next v4 0/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-12  0:09   ` [PATCH net-next v4 1/9] dt-bindings: net: dsa: realtek: add RTL8367S-V Mieczyslaw Nalewaj
2026-10-12  9:31     ` Linus Walleij
2026-10-12 14:15     ` Mieczyslaw Nalewaj
2026-10-13  1:08     ` netdev-bot+sashiko
2026-10-12  0:10   ` [PATCH net-next v4 2/9] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-10-12  0:11   ` [PATCH net-next v4 3/9] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-10-12  0:12   ` [PATCH net-next v4 4/9] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-10-13  1:08     ` netdev-bot+sashiko [this message]
2026-10-12  0:12   ` [PATCH net-next v4 5/9] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-10-13  1:08     ` netdev-bot+sashiko
2026-10-12  0:13   ` [PATCH net-next v4 6/9] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-10-12  0:14   ` [PATCH net-next v4 7/9] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-10-13  1:08     ` netdev-bot+sashiko
2026-10-12  0:15   ` [PATCH net-next v4 8/9] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-10-13  1:08     ` netdev-bot+sashiko
2026-10-12  0:16   ` [PATCH net-next v4 9/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-13  1:08     ` netdev-bot+sashiko

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=179185370913.434549.1834502511257239861@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luizluca@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=namiltd@yahoo.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®