]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: intel: remove eee_usecs_rate and hardware write
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sat, 12 Apr 2025 08:08:35 +0000 (09:08 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Apr 2025 00:12:40 +0000 (17:12 -0700)
Remove the write to GMAC_1US_TIC_COUNTER for two reasons:

1. during initialisation or reinitialisation of the DWMAC core, the
   core is reset, which sets this register back to its default value.
   Writing it prior to stmmac_dvr_probe() has no effect.

2. Since commit 8efbdbfa9938 ("net: stmmac: Initialize
   MAC_ONEUS_TIC_COUNTER register"), GMAC4/5 core code will set
   this register based on the rate of plat->stmmac_clk. This clock
   is created by the same code which initialises plat->eee_usecs_rate,
   which is also created to run at this same rate. Since Marek's
   commit, this will set this register appropriately using the
   rate of this clock.

Therefore, dwmac-intel.c writing GMAC_1US_TIC_COUNTER serves no
useful purpose and can be removed.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1u3Vul-000E7m-1j@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c

index c8bb9265bbb48af1491ab0a94ffff2eb15342443..54db5b778304da61e5a44368f380e80f5d0632c8 100644 (file)
@@ -682,7 +682,6 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
        plat->axi->axi_blen[2] = 16;
 
        plat->ptp_max_adj = plat->clk_ptp_rate;
-       plat->eee_usecs_rate = plat->clk_ptp_rate;
 
        /* Set system clock */
        sprintf(clk_name, "%s-%s", "stmmac", pci_name(pdev));
@@ -1313,13 +1312,6 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
        memset(&res, 0, sizeof(res));
        res.addr = pcim_iomap_table(pdev)[0];
 
-       if (plat->eee_usecs_rate > 0) {
-               u32 tx_lpi_usec;
-
-               tx_lpi_usec = (plat->eee_usecs_rate / 1000000) - 1;
-               writel(tx_lpi_usec, res.addr + GMAC_1US_TIC_COUNTER);
-       }
-
        ret = stmmac_config_multi_msi(pdev, plat, &res);
        if (ret) {
                ret = stmmac_config_single_msi(pdev, plat, &res);