net: bcm: asp2: fix LPI timer handling
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 14 Jan 2025 16:50:47 +0000 (16:50 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 15 Jan 2025 21:17:56 +0000 (13:17 -0800)
Fix the LPI timer handling in Broadcom ASP2 driver after the phylib
managed EEE patches were merged.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/E1tXk7r-000r4l-Li@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c

index 9da5ae29a1050b32f775a02b8c4e67a266531d83..139058a0dbbbd31bfa3b06e08d76fd1636aa56a7 100644 (file)
@@ -371,7 +371,6 @@ static int bcmasp_get_eee(struct net_device *dev, struct ethtool_keee *e)
                return -ENODEV;
 
        e->tx_lpi_enabled = p->tx_lpi_enabled;
-       e->tx_lpi_timer = umac_rl(intf, UMC_EEE_LPI_TIMER);
 
        return phy_ethtool_get_eee(dev->phydev, e);
 }
@@ -395,7 +394,6 @@ static int bcmasp_set_eee(struct net_device *dev, struct ethtool_keee *e)
                        return ret;
                }
 
-               umac_wl(intf, e->tx_lpi_timer, UMC_EEE_LPI_TIMER);
                intf->eee.tx_lpi_enabled = e->tx_lpi_enabled;
                bcmasp_eee_enable_set(intf, true);
        }
index cfd50efbdbc0c494be7c538f7d58a9aab1108171..62861a454a273c357a9a45f00761e867d087e017 100644 (file)
@@ -677,6 +677,8 @@ static void bcmasp_adj_link(struct net_device *dev)
                }
                umac_wl(intf, reg, UMC_CMD);
 
+               umac_wl(intf, phydev->eee_cfg.tx_lpi_timer, UMC_EEE_LPI_TIMER);
+
                active = phy_init_eee(phydev, 0) >= 0;
                bcmasp_eee_enable_set(intf, active);
        }
@@ -1055,6 +1057,9 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect)
 
                /* Indicate that the MAC is responsible for PHY PM */
                phydev->mac_managed_pm = true;
+
+               /* Set phylib's copy of the LPI timer */
+               phydev->eee_cfg.tx_lpi_timer = umac_rl(intf, UMC_EEE_LPI_TIMER);
        }
 
        umac_reset(intf);