* [PATCH net-next v2] net: phy: marvell: Fix 88e1510 downshift counter errata
@ 2025-09-06 2:33 Rohan G Thomas via B4 Relay
2025-09-10 2:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Rohan G Thomas via B4 Relay @ 2025-09-06 2:33 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Rohan G Thomas, Matthew Gerlach
From: Rohan G Thomas <rohan.g.thomas@altera.com>
The 88e1510 PHY has an erratum where the phy downshift counter is not
cleared after phy being suspended(BMCR_PDOWN set) and then later
resumed(BMCR_PDOWN cleared). This can cause the gigabit link to
intermittently downshift to a lower speed.
Disabling and re-enabling the downshift feature clears the counter,
allowing the PHY to retry gigabit link negotiation up to the programmed
retry count times before downshifting. This behavior has been observed
on copper links.
Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
Changes in v2:
- Updated commit message and function description.
- Link to v1: https://lore.kernel.org/r/20250902-marvell_fix-v1-1-9fba7a6147dd@altera.com
---
drivers/net/phy/marvell.c | 39 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 623292948fa706a2b0d8b98919ead8b609bbd949..0ea366c1217eb3a6ddc26a8333280c211bd9545c 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1902,6 +1902,43 @@ static int marvell_resume(struct phy_device *phydev)
return err;
}
+/* m88e1510_resume
+ *
+ * The 88e1510 PHY has an erratum where the phy downshift counter is not cleared
+ * after phy being suspended(BMCR_PDOWN set) and then later resumed(BMCR_PDOWN
+ * cleared). This can cause the link to intermittently downshift to a lower speed.
+ *
+ * Disabling and re-enabling the downshift feature clears the counter, allowing
+ * the PHY to retry gigabit link negotiation up to the programmed retry count
+ * before downshifting. This behavior has been observed on copper links.
+ */
+static int m88e1510_resume(struct phy_device *phydev)
+{
+ int err;
+ u8 cnt = 0;
+
+ err = marvell_resume(phydev);
+ if (err < 0)
+ return err;
+
+ /* read downshift counter value */
+ err = m88e1011_get_downshift(phydev, &cnt);
+ if (err < 0)
+ return err;
+
+ if (cnt) {
+ /* downshift disabled */
+ err = m88e1011_set_downshift(phydev, 0);
+ if (err < 0)
+ return err;
+
+ /* downshift enabled, with previous counter value */
+ err = m88e1011_set_downshift(phydev, cnt);
+ }
+
+ return err;
+}
+
static int marvell_aneg_done(struct phy_device *phydev)
{
int retval = phy_read(phydev, MII_M1011_PHY_STATUS);
@@ -3923,7 +3960,7 @@ static struct phy_driver marvell_drivers[] = {
.handle_interrupt = marvell_handle_interrupt,
.get_wol = m88e1318_get_wol,
.set_wol = m88e1318_set_wol,
- .resume = marvell_resume,
+ .resume = m88e1510_resume,
.suspend = marvell_suspend,
.read_page = marvell_read_page,
.write_page = marvell_write_page,
---
base-commit: 2fd4161d0d2547650d9559d57fc67b4e0a26a9e3
change-id: 20250902-marvell_fix-3f2a3d5e0fca
Best regards,
--
Rohan G Thomas <rohan.g.thomas@altera.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v2] net: phy: marvell: Fix 88e1510 downshift counter errata
2025-09-06 2:33 [PATCH net-next v2] net: phy: marvell: Fix 88e1510 downshift counter errata Rohan G Thomas via B4 Relay
@ 2025-09-10 2:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-10 2:40 UTC (permalink / raw)
To: Rohan G Thomas
Cc: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, matthew.gerlach
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 06 Sep 2025 10:33:31 +0800 you wrote:
> From: Rohan G Thomas <rohan.g.thomas@altera.com>
>
> The 88e1510 PHY has an erratum where the phy downshift counter is not
> cleared after phy being suspended(BMCR_PDOWN set) and then later
> resumed(BMCR_PDOWN cleared). This can cause the gigabit link to
> intermittently downshift to a lower speed.
>
> [...]
Here is the summary with links:
- [net-next,v2] net: phy: marvell: Fix 88e1510 downshift counter errata
https://git.kernel.org/netdev/net-next/c/deb105f49879
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-10 2:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-06 2:33 [PATCH net-next v2] net: phy: marvell: Fix 88e1510 downshift counter errata Rohan G Thomas via B4 Relay
2025-09-10 2:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).