mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: paul.louvel@bootlin.com
Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, maxime.chevallier@bootlin.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, miquel.raynal@bootlin.com,
	herve.codina@bootlin.com
Subject: Re: [PATCH net-next v3 4/4] net: phy: marvell: add RGMII-to-Copper mode configuration
Date: Tue, 24 Nov 2026 18:01:39 +0000	[thread overview]
Message-ID: <179554329951.3135.10331717486625709759@kernel.org> (raw)
In-Reply-To: <20261120-marvell-phy-rgmii-v3-4-c11c99798931@bootlin.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] On RGMII-attached 88E151x PHYs with an SFP cage,
  m88e1510_config_init() (drivers/net/phy/marvell.c:1409-1410) now…
- [Medium] Before this patch, m88e1510_config_init() did not touch
  GEN_CTRL_REG_1[2:0] for RGMII-attached 88E1510/1512/1514/1518 PHYs.

--

net: phy: marvell: add RGMII-to-Copper mode configuration

This commit extends m88e1510_config_init() so it programs the
GEN_CTRL_REG_1 mode field when the interface is any rgmii variant. The mode
written is RGMII-to-Copper. Before, only the SGMII-to-Copper case was
handled.

> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index a72d307eaf12c..423d146426ff5 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -1403,9 +1403,11 @@ static int m88e1510_config_init(struct phy_device *phydev)
>  	if (err < 0)
>  		return err;
>  
> -	/* SGMII-to-Copper mode initialization */
> +	/* RGMII/SGMII-to-Copper mode initialization */
>  	if (phydev->interface == PHY_INTERFACE_MODE_SGMII)
>  		err = m88e1510_config_mode(phydev, MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII);
> +	else if (phy_interface_is_rgmii(phydev))
> +		err = m88e1510_config_mode(phydev, MII_88E1510_GEN_CTRL_REG_1_MODE_RGMII);

[Severity: High]
Can this overwrite the serdes mode that was set for an SFP module on
88E1512 boards with an RGMII host and an SFP cage?

When a module is inserted, m88e1510_port_configure_serdes() writes the same
MODE field:

drivers/net/phy/marvell.c:m88e1510_port_configure_serdes() {
    ...
		case PHY_INTERFACE_MODE_1000BASEX:
			mode = MII_88E1510_GEN_CTRL_REG_1_MODE_RGMII_1000X;
    ...
	return m88e1510_config_mode(phydev, mode);
}

That write happens only through phy_sfp_module_insert()->configure_mii(),
once per insertion event. The SFP upstream is registered at phy_probe()
time, and sfp_sm_module() reports the insertion from SFP_MOD_WAITDEV. So
the module is normally configured before the MAC attaches the PHY.

After that, each of these paths runs config_init again:

phy_attach_direct()->phy_init_hw()->m88e1510_config_init()
mdio_bus_phy_resume()->phy_init_hw()->m88e1510_config_init()
phy_abort_cable_test()->phy_init_hw()->m88e1510_config_init()
SIOCSMIIREG with BMCR_RESET -> phy_init_hw()->m88e1510_config_init()

With this change, phy_interface_is_rgmii() is true on these boards. MODE is
forced back to RGMII-to-Copper and the PHY gets a soft reset. Nothing calls
configure_mii again after phy_init_hw(). Would the SFP link then stay down
until the module is physically re-plugged?

Before this patch, config_init did not touch the mode for RGMII, and the
88E1510 driver entry has no .soft_reset. That meant the SFP mode survived
phy_init_hw(). This RGMII-host SFP setup is the one supported by commit
b697d9d38a5a ("net: phy: marvell: add SFP support for 88E1510") and commit
1384e1383829 ("net: phy: marvell: Support SFP through phy_port interface").
The commit message does not mention how the change interacts with them.

[Severity: Medium]
Does this also override a fibre or auto-media mode that was set outside the
kernel, for example by straps or the bootloader, on RGMII-attached
88E151x PHYs?

The 88E1510 entry advertises PHY_GBIT_FIBRE_FEATURES. Since commit
6cfb3bcc0641 ("Marvell phy: check link status in case of fiber link."),
marvell_read_status() checks the fibre page for non-SGMII hosts:

drivers/net/phy/marvell.c:marvell_read_status() {
    ...
	if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
			      phydev->supported) &&
	    phydev->interface != PHY_INTERFACE_MODE_SGMII) {
		err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
    ...
}

If MODE is forced to 000 (RGMII-to-Copper) on every config_init, the fibre
side looks disabled on such boards. marvell_read_status() would then never
see a fibre link.

Also, m88e1510_config_mode() always sets MII_88E1510_GEN_CTRL_REG_1_RESET,
even when the mode does not change. Every RGMII user now gets a mode soft
reset on each config_init, where before only SGMII did. Should the commit
message describe this change in behaviour, and the failure that motivated
the patch?

>  	if (err < 0)
>  		return err;
>

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120-marvell-phy-rgmii-v3-0-c11c99798931%40bootlin.com

      reply	other threads:[~2026-11-24 18:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 17:05 [PATCH net-next v3 0/4] " Paul Louvel
2026-11-20 17:05 ` [PATCH net-next v3 1/4] net: phy: marvell: move mode configuration into standalone function Paul Louvel
2026-11-20 17:05 ` [PATCH net-next v3 2/4] net: phy: marvell: de-duplicate mode initialization code Paul Louvel
2026-11-20 17:05 ` [PATCH net-next v3 3/4] net: phy: marvell: factor out EEE errata initialization Paul Louvel
2026-11-20 17:05 ` [PATCH net-next v3 4/4] net: phy: marvell: add RGMII-to-Copper mode configuration Paul Louvel
2026-11-24 18:01   ` netdev-bot+sashiko [this message]

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=179554329951.3135.10331717486625709759@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul.louvel@bootlin.com \
    --cc=thomas.petazzoni@bootlin.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®