Skip to contentSkip to conversation

net: stmmac: imx: use phylink's interface mode for set_clk_tx_rate()

PATCH In review Russell King (Oracle) 3 participants 3 messages Oct 31, 2025 – Nov 4, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: imx: use phylink's interface mode for set_clk_tx_rate()

imx_dwmac_set_clk_tx_rate() is passed the interface mode from phylink which will be the same as plat_dat->phy_interface. Use the passed-in interface mode rather than plat_dat->phy_interface.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0 -3
index 4268b9987237..147fa08d5b6e 100644
@@ -195,9 +195,6 @@ static void imx_dwmac_exit(struct platform_device *pdev, void *priv)
 static int imx_dwmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
 				     phy_interface_t interface, int speed)
 {
-	struct imx_priv_data *dwmac = bsp_priv;
-
-	interface = dwmac->plat_dat->phy_interface;
 	if (interface == PHY_INTERFACE_MODE_RMII ||
 	    interface == PHY_INTERFACE_MODE_MII)
 		return 0;
Signature · 1 line
2.47.3
maintainer Reviewed-by Tested-by on v1 1/1
#1 lore raw

Hi Russell,

Quoted 5 lines · Russell King (Oracle)

imx_dwmac_set_clk_tx_rate() is passed the interface mode from phylink which will be the same as plat_dat->phy_interface. Use the passed-in interface mode rather than plat_dat->phy_interface.

Tested on imx8mp w/ rgmii-id PHY (ksz9131)

Maxime

Quoted 18 lines
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0 -3
index 4268b9987237..147fa08d5b6e 100644
@@ -195,9 +195,6 @@ static void imx_dwmac_exit(struct platform_device *pdev, void *priv)
 static int imx_dwmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
 				     phy_interface_t interface, int speed)
 {
-	struct imx_priv_data *dwmac = bsp_priv;
-
-	interface = dwmac->plat_dat->phy_interface;
 	if (interface == PHY_INTERFACE_MODE_RMII ||
 	    interface == PHY_INTERFACE_MODE_MII)
 		return 0;
#2 lore raw
In reply to Russell King (Oracle)
Quoted 5 lines · Russell King (Oracle)

imx_dwmac_set_clk_tx_rate() is passed the interface mode from phylink which will be the same as plat_dat->phy_interface. Use the passed-in interface mode rather than plat_dat->phy_interface.

While checking patchwork this morning, this patch was unexpectedly marked as superseded. It appears I accidentally posted it as part of the multi-interface stmmac series. This should not have happened. Please apply _this_ patch as it has Maxime's attributations on, whereas the mistakenly reposted patch does not.

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