[PATCH net v4 2/2] net: phy: micrel: lan8842 errata

Horatiu Vultur posted 2 patches 1 month, 2 weeks ago
[PATCH net v4 2/2] net: phy: micrel: lan8842 errata
Posted by Horatiu Vultur 1 month, 2 weeks ago
Add errata for lan8842. The errata document can be found here [1].
This is fixing the module 7 ("1000BASE-T PMA EEE TX wake timer is
non-compliant")

[1] https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/Errata/LAN8842-Errata-DS80001172.pdf

Fixes: 5a774b64cd6a ("net: phy: micrel: Add support for lan8842")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/phy/micrel.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 1fa56d4c17937..6a1a424e3b30f 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -5965,6 +5965,9 @@ static int lan8842_probe(struct phy_device *phydev)
 
 #define LAN8814_POWER_MGMT_VAL5		LAN8814_POWER_MGMT_B_C_D
 
+#define LAN8814_EEE_WAKE_TX_TIMER			0x0e
+#define LAN8814_EEE_WAKE_TX_TIMER_MAX_VAL		0x1f
+
 static const struct lanphy_reg_data short_center_tap_errata[] = {
 	{ LAN8814_PAGE_POWER_REGS,
 	  LAN8814_POWER_MGMT_MODE_3_ANEG_MDI,
@@ -6004,6 +6007,12 @@ static const struct lanphy_reg_data short_center_tap_errata[] = {
 	  LAN8814_POWER_MGMT_VAL4 },
 };
 
+static const struct lanphy_reg_data waketx_timer_errata[] = {
+	{ LAN8814_PAGE_EEE,
+	  LAN8814_EEE_WAKE_TX_TIMER,
+	  LAN8814_EEE_WAKE_TX_TIMER_MAX_VAL },
+};
+
 static int lanphy_write_reg_data(struct phy_device *phydev,
 				 const struct lanphy_reg_data *data,
 				 size_t num)
@@ -6022,8 +6031,15 @@ static int lanphy_write_reg_data(struct phy_device *phydev,
 
 static int lan8842_erratas(struct phy_device *phydev)
 {
-	return lanphy_write_reg_data(phydev, short_center_tap_errata,
+	int ret;
+
+	ret = lanphy_write_reg_data(phydev, short_center_tap_errata,
 				    ARRAY_SIZE(short_center_tap_errata));
+	if (ret)
+		return ret;
+
+	return lanphy_write_reg_data(phydev, waketx_timer_errata,
+				     ARRAY_SIZE(waketx_timer_errata));
 }
 
 static int lan8842_config_init(struct phy_device *phydev)
-- 
2.34.1
Re: [PATCH net v4 2/2] net: phy: micrel: lan8842 errata
Posted by Russell King (Oracle) 1 month, 2 weeks ago
On Fri, Oct 31, 2025 at 01:16:29PM +0100, Horatiu Vultur wrote:
> Add errata for lan8842. The errata document can be found here [1].
> This is fixing the module 7 ("1000BASE-T PMA EEE TX wake timer is
> non-compliant")
> 
> [1] https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/Errata/LAN8842-Errata-DS80001172.pdf
> 
> Fixes: 5a774b64cd6a ("net: phy: micrel: Add support for lan8842")
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>

Same comment.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!