]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: remove unused PCS loopback support
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 16 Oct 2025 14:37:06 +0000 (15:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 21 Oct 2025 00:17:14 +0000 (17:17 -0700)
Nothing calls stmmac_pcs_ctrl_ane() with the "loopback" argument set to
anything except zero, so this serves no useful purpose. Remove the
argument to reduce the code complexity.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/E1v9P6I-0000000Aola-3Sih@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h

index f62825220cf70a884c62c590c08979663267f3be..32244217d95266bf0573072f66f8970f651b25ef 100644 (file)
@@ -622,7 +622,7 @@ static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed)
 
 static void ethqos_pcs_set_inband(struct stmmac_priv *priv, bool enable)
 {
-       stmmac_pcs_ctrl_ane(priv, enable, 0, 0);
+       stmmac_pcs_ctrl_ane(priv, enable, 0);
 }
 
 /* On interface toggle MAC registers gets reset.
index 654331b411f4469b8be778bd0af8c3ec1622a3a4..5c653be3d453ff37045d3fb22575a8b1a2fb4e57 100644 (file)
@@ -358,9 +358,9 @@ static void dwmac1000_set_eee_timer(struct mac_device_info *hw, int ls, int tw)
 }
 
 static void dwmac1000_ctrl_ane(struct stmmac_priv *priv, bool ane,
-                              bool srgmi_ral, bool loopback)
+                              bool srgmi_ral)
 {
-       dwmac_ctrl_ane(priv->ioaddr, GMAC_PCS_BASE, ane, srgmi_ral, loopback);
+       dwmac_ctrl_ane(priv->ioaddr, GMAC_PCS_BASE, ane, srgmi_ral);
 }
 
 static void dwmac1000_debug(struct stmmac_priv *priv, void __iomem *ioaddr,
index bff4c371c1d26103a93fa6d58304a9f6e8347b95..21e4461db937827571bf6c7ffbe996b9c6d635ed 100644 (file)
@@ -583,10 +583,9 @@ static void dwmac4_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,
        }
 }
 
-static void dwmac4_ctrl_ane(struct stmmac_priv *priv, bool ane, bool srgmi_ral,
-                           bool loopback)
+static void dwmac4_ctrl_ane(struct stmmac_priv *priv, bool ane, bool srgmi_ral)
 {
-       dwmac_ctrl_ane(priv->ioaddr, GMAC_PCS_BASE, ane, srgmi_ral, loopback);
+       dwmac_ctrl_ane(priv->ioaddr, GMAC_PCS_BASE, ane, srgmi_ral);
 }
 
 static int dwmac4_irq_mtl_status(struct stmmac_priv *priv,
index 14dbe0685997db5f0432445c1bb3c45ace16ce26..7796f5f3c96f1db8fd8733d0bb8c243e6601c740 100644 (file)
@@ -374,8 +374,8 @@ struct stmmac_ops {
                      struct stmmac_extra_stats *x, u32 rx_queues,
                      u32 tx_queues);
        /* PCS calls */
-       void (*pcs_ctrl_ane)(struct stmmac_priv *priv, bool ane, bool srgmi_ral,
-                            bool loopback);
+       void (*pcs_ctrl_ane)(struct stmmac_priv *priv, bool ane,
+                            bool srgmi_ral);
        /* Safety Features */
        int (*safety_feat_config)(void __iomem *ioaddr, unsigned int asp,
                                  struct stmmac_safety_feature_cfg *safety_cfg);
index 867d0ca3b45e2776f7532d2fc73f9e808773c57b..e21d96933408a973f0d4e5e52848f6903aa52e8f 100644 (file)
@@ -3493,7 +3493,7 @@ static int stmmac_hw_setup(struct net_device *dev)
        }
 
        if (priv->hw->pcs)
-               stmmac_pcs_ctrl_ane(priv, 1, priv->hw->ps, 0);
+               stmmac_pcs_ctrl_ane(priv, 1, priv->hw->ps);
 
        /* set TX and RX rings length */
        stmmac_set_rings_length(priv);
index 4a684c97dfaeb1b4fbcb02ddc0a1f1f962fe6ca2..5778f5b2f3139a48247d08deccd406dd67af634b 100644 (file)
@@ -82,13 +82,12 @@ static inline void dwmac_pcs_isr(void __iomem *ioaddr, u32 reg,
  * @reg: Base address of the AN Control Register.
  * @ane: to enable the auto-negotiation
  * @srgmi_ral: to manage MAC-2-MAC SGMII connections.
- * @loopback: to cause the PHY to loopback tx data into rx path.
  * Description: this is the main function to configure the AN control register
  * and init the ANE, select loopback (usually for debugging purpose) and
  * configure SGMII RAL.
  */
 static inline void dwmac_ctrl_ane(void __iomem *ioaddr, u32 reg, bool ane,
-                                 bool srgmi_ral, bool loopback)
+                                 bool srgmi_ral)
 {
        u32 value = readl(ioaddr + GMAC_AN_CTRL(reg));
 
@@ -104,9 +103,6 @@ static inline void dwmac_ctrl_ane(void __iomem *ioaddr, u32 reg, bool ane,
        if (srgmi_ral)
                value |= GMAC_AN_CTRL_SGMRAL;
 
-       if (loopback)
-               value |= GMAC_AN_CTRL_ELE;
-
        writel(value, ioaddr + GMAC_AN_CTRL(reg));
 }
 #endif /* __STMMAC_PCS_H__ */