Re: [PATCH net-next v3 4/4] net: phy: marvell: add RGMII-to-Copper mode configuration
From: netdev-bot+sashiko
Date: Tue Nov 24 2026 - 13:01:55 EST
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