Netdev List
 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 v2 3/4] net: phy: marvell: factor out EEE errata initialization
Date: Thu, 19 Nov 2026 06:29:09 +0000	[thread overview]
Message-ID: <179506974989.3136.8384234607101047972@kernel.org> (raw)
In-Reply-To: <20261116-marvell-phy-rgmii-v2-3-e04dca67e89a@bootlin.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] In m88e1510_eee_errata() (drivers/net/phy/marvell.c), the patch
  changes the sequence of register writes the PHY receives even when…

--

net: phy: marvell: factor out EEE errata initialization

This patch moves the 88E151x EEE errata register sequence out of
m88e1510_config_init() and into a new helper, m88e1510_eee_errata(). The
page 0xFF writes now go through phy_select_page(), __phy_write() and
phy_restore_page(). The final page 0xFB write now uses phy_write_paged().

> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index d2c5d3c5ce7d1..a72d307eaf12c 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c

[ ... ]

> @@ -1363,31 +1363,40 @@ static int m88e1510_config_init(struct phy_device *phydev)
>  		{ 0xb233, 0x214d },
>  		{ 0xcc0c, 0x2159 },
>  	};
> -	int err;
> -	int i;
> +	int i, oldpage, ret = 0;
>  
>  	/* As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/
>  	 * 88E1514 Rev A0, Errata Section 5.1:
>  	 * If EEE is intended to be used, the following register writes
>  	 * must be done once after every hardware reset.
>  	 */
> -	err = marvell_set_page(phydev, 0x00FF);
> -	if (err < 0)
> -		return err;
> +	oldpage = phy_select_page(phydev, 0x00FF);
> +	if (oldpage < 0)
> +		goto restore;
>  
>  	for (i = 0; i < ARRAY_SIZE(errata_vals); ++i) {

[ ... ]

>  	}
>  
> -	err = marvell_set_page(phydev, 0x00FB);
> -	if (err < 0)
> -		return err;
> -	err = phy_write(phydev, 07, 0xC00D);
> +restore:
> +	ret = phy_restore_page(phydev, oldpage, ret);
> +	if (ret < 0)
> +		return ret;
> +
> +	return phy_write_paged(phydev, 0x00FB, 07, 0xC00D);

[Severity: Low]
Is it intended that the PHY now gets a different sequence of MDIO accesses
when nothing fails, and not only on the error path?

Before this patch, m88e1510_config_init() did:

    write page 0xFF
    write reg17/reg16 x4
    write page 0xFB
    write reg 7 = 0xC00D

After this patch, m88e1510_eee_errata() does:

    phy_select_page()    read page, write page 0xFF
    __phy_write()        write reg17/reg16 x4
    phy_restore_page()   write original page
    phy_write_paged()    read page, write page 0xFB,
                         write reg 7 = 0xC00D,
                         write original page

The PHY now switches back to the original page (normally the copper page
after reset) between the page 0xFF part and the page 0xFB part of the
vendor errata sequence. The number of MDIO transactions also goes from 11
to about 15.

These are undocumented vendor registers, so it isn't clear whether the
extra page switch matters to the hardware.

The commit message only says:

  "This reduces the number of bus lock/unlock cycles and restores the
  previous page if one of the errata writes fails."

Could the commit message also mention the changed write sequence on the
success path? Could it also say whether this was tested on 88E1510/1518/
1512/1514 Rev A0 parts?

The last patch of the series, "net: phy: marvell: add RGMII-to-Copper mode
configuration", leaves this code as it is.

> +}
> +
> +static int m88e1510_config_init(struct phy_device *phydev)
> +{
> +	int err;
> +
> +	err = m88e1510_eee_errata(phydev);
>  	if (err < 0)
>  		return err;
>  	err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);

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

  parent reply	other threads:[~2026-11-19  6:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 15:27 [PATCH net-next v2 0/4] net: phy: marvell: add RGMII-to-Copper mode configuration Paul Louvel
2026-11-16 15:27 ` [PATCH net-next v2 1/4] net: phy: marvell: move mode configuration into standalone function Paul Louvel
2026-11-17  2:02   ` Andrew Lunn
2026-11-16 15:27 ` [PATCH net-next v2 2/4] net: phy: marvell: de-duplicate mode initialization code Paul Louvel
2026-11-17  2:03   ` Andrew Lunn
2026-11-16 15:27 ` [PATCH net-next v2 3/4] net: phy: marvell: factor out EEE errata initialization Paul Louvel
2026-11-17  2:04   ` Andrew Lunn
2026-11-19  6:29   ` netdev-bot+sashiko [this message]
2026-11-16 15:27 ` [PATCH net-next v2 4/4] net: phy: marvell: add RGMII-to-Copper mode configuration Paul Louvel
2026-11-18  8:20   ` Maxime Chevallier
2026-11-19  6:29   ` 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=179506974989.3136.8384234607101047972@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