]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: phy: micrel: Add ksz9131_resume()
authorBiju Das <biju.das.jz@bp.renesas.com>
Fri, 11 Jul 2025 05:40:21 +0000 (06:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:30:31 +0000 (18:30 +0200)
[ Upstream commit f25a7eaa897f21396e99f90809af82ca553c9d14 ]

The Renesas RZ/G3E SMARC EVK uses KSZ9131RNXC phy. On deep power state,
PHY loses the power and on wakeup the rgmii delays are not reconfigured
causing it to fail.

Replace the callback kszphy_resume()->ksz9131_resume() for reconfiguring
the rgmii_delay when it exits from PM suspend state.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250711054029.48536-1-biju.das.jz@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/micrel.c

index 88a3c18f82aef06cf098b0e322f244c32a244c32..92e9eb4146d9b27e472acfc8e1f88f6aafa129f3 100644 (file)
@@ -5394,6 +5394,14 @@ static int lan8841_suspend(struct phy_device *phydev)
        return kszphy_generic_suspend(phydev);
 }
 
+static int ksz9131_resume(struct phy_device *phydev)
+{
+       if (phydev->suspended && phy_interface_is_rgmii(phydev))
+               ksz9131_config_rgmii_delay(phydev);
+
+       return kszphy_resume(phydev);
+}
+
 static struct phy_driver ksphy_driver[] = {
 {
        .phy_id         = PHY_ID_KS8737,
@@ -5639,7 +5647,7 @@ static struct phy_driver ksphy_driver[] = {
        .get_strings    = kszphy_get_strings,
        .get_stats      = kszphy_get_stats,
        .suspend        = kszphy_suspend,
-       .resume         = kszphy_resume,
+       .resume         = ksz9131_resume,
        .cable_test_start       = ksz9x31_cable_test_start,
        .cable_test_get_status  = ksz9x31_cable_test_get_status,
        .get_features   = ksz9477_get_features,