Skip to contentSkip to conversation

net: stmmac: clarify difference between "interface" and "phy_interface"

PATCH Applied Russell King (Oracle) 4 participants 5 messages Aug 26, 2023 – Aug 29, 2023

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

PATCH 1/1 net: stmmac: clarify difference between "interface" and "phy_interface"

Clarify the difference between "interface" and "phy_interface" in struct plat_stmmacenet_data, both by adding a comment, and also renaming "interface" to be "mac_interface". The difference between these are:

MAC ----- optional PCS ----- SerDes ----- optional PHY ----- Media
^ ^
mac_interface phy_interface

Note that phylink currently only deals with phy_interface.

---

One last patch before Sunday - I would like to get this merged as it touches multiple stmmac platforms before any further are added.

This patch merely renames the "plat_dat->interface" to "->mac_interface" but doesn't change which any code uses.

All code which uses plat->interface (now plat->mac_interface) are determining the interface from the MAC side not the PHY side. These need a code review against the docs to check whether that is correct. Essentially, every .c file touched by this needs a code review. This code review should not affect whether this patch is merged.

 .../net/ethernet/stmicro/stmmac/dwmac-imx.c   | 14 ++++++-------
 .../ethernet/stmicro/stmmac/dwmac-ingenic.c   | 20 +++++++++----------
 .../ethernet/stmicro/stmmac/dwmac-loongson.c  |  2 +-
 .../ethernet/stmicro/stmmac/dwmac-lpc18xx.c   |  4 ++--
 .../ethernet/stmicro/stmmac/dwmac-mediatek.c  |  2 +-
 .../ethernet/stmicro/stmmac/dwmac-socfpga.c   |  2 +-
 .../ethernet/stmicro/stmmac/dwmac-starfive.c  |  4 ++--
 .../net/ethernet/stmicro/stmmac/dwmac-stm32.c |  8 ++++----
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c |  6 +++---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  6 ++++--
 .../ethernet/stmicro/stmmac/stmmac_platform.c |  6 +++---
 include/linux/stmmac.h                        | 15 +++++++++++++-
 12 files changed, 52 insertions(+), 37 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +7 -7
index 535856fffaea..df34e34cc14f 100644
@@ -70,7 +70,7 @@ static int imx8mp_set_intf_mode(struct plat_stmmacenet_data *plat_dat)
 	struct imx_priv_data *dwmac = plat_dat->bsp_priv;
 	int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = GPR_ENET_QOS_INTF_SEL_MII;
 		break;
@@ -87,7 +87,7 @@ static int imx8mp_set_intf_mode(struct plat_stmmacenet_data *plat_dat)
 		break;
 	default:
 		pr_debug("imx dwmac doesn't support %d interface\n",
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -110,7 +110,7 @@ static int imx93_set_intf_mode(struct plat_stmmacenet_data *plat_dat)
 	struct imx_priv_data *dwmac = plat_dat->bsp_priv;
 	int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = MX93_GPR_ENET_QOS_INTF_SEL_MII;
 		break;
@@ -125,7 +125,7 @@ static int imx93_set_intf_mode(struct plat_stmmacenet_data *plat_dat)
 		break;
 	default:
 		dev_dbg(dwmac->dev, "imx dwmac doesn't support %d interface\n",
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -192,8 +192,8 @@ static void imx_dwmac_fix_speed(void *priv, unsigned int speed, unsigned int mod
 	plat_dat = dwmac->plat_dat;
 
 	if (dwmac->ops->mac_rgmii_txclk_auto_adj ||
-	    (plat_dat->interface == PHY_INTERFACE_MODE_RMII) ||
-	    (plat_dat->interface == PHY_INTERFACE_MODE_MII))
+	    (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) ||
+	    (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII))
 		return;
 
 	switch (speed) {
@@ -260,7 +260,7 @@ static int imx_dwmac_mx93_reset(void *priv, void __iomem *ioaddr)
 	value |= DMA_BUS_MODE_SFT_RESET;
 	writel(value, ioaddr + DMA_BUS_MODE);
 
-	if (plat_dat->interface == PHY_INTERFACE_MODE_RMII) {
+	if (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) {
 		usleep_range(100, 200);
 		writel(RMII_RESET_SPEED, ioaddr + MAC_CTRL_REG);
 	}
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +10 -10
index e22ef0d6bc73..0a20c3d24722 100644
@@ -89,7 +89,7 @@ static int jz4775_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 	struct ingenic_mac *mac = plat_dat->bsp_priv;
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = FIELD_PREP(MACPHYC_TXCLK_SEL_MASK, MACPHYC_TXCLK_SEL_INPUT) |
 			  FIELD_PREP(MACPHYC_PHY_INFT_MASK, MACPHYC_PHY_INFT_MII);
@@ -118,7 +118,7 @@ static int jz4775_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 		break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -130,13 +130,13 @@ static int x1000_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 {
 	struct ingenic_mac *mac = plat_dat->bsp_priv;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
 		break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -149,14 +149,14 @@ static int x1600_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 	struct ingenic_mac *mac = plat_dat->bsp_priv;
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		val = FIELD_PREP(MACPHYC_PHY_INFT_MASK, MACPHYC_PHY_INFT_RMII);
 		dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
 		break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -169,7 +169,7 @@ static int x1830_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 	struct ingenic_mac *mac = plat_dat->bsp_priv;
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		val = FIELD_PREP(MACPHYC_MODE_SEL_MASK, MACPHYC_MODE_SEL_RMII) |
 			  FIELD_PREP(MACPHYC_PHY_INFT_MASK, MACPHYC_PHY_INFT_RMII);
@@ -177,7 +177,7 @@ static int x1830_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 		break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -190,7 +190,7 @@ static int x2000_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 	struct ingenic_mac *mac = plat_dat->bsp_priv;
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		val = FIELD_PREP(MACPHYC_TX_SEL_MASK, MACPHYC_TX_SEL_ORIGIN) |
 			  FIELD_PREP(MACPHYC_RX_SEL_MASK, MACPHYC_RX_SEL_ORIGIN) |
@@ -220,7 +220,7 @@ static int x2000_mac_set_mode(struct plat_stmmacenet_data *plat_dat)
 		break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +1 -1
index a25c187d3185..2cd6fce5c993 100644
@@ -117,7 +117,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 	}
 
 	plat->phy_interface = phy_mode;
-	plat->interface = PHY_INTERFACE_MODE_GMII;
+	plat->mac_interface = PHY_INTERFACE_MODE_GMII;
 
 	pci_set_master(pdev);
 
drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c +2 -2
index 18e84ba693a6..d0aa674ce705 100644
@@ -50,9 +50,9 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
 		goto err_remove_config_dt;
 	}
 
-	if (plat_dat->interface == PHY_INTERFACE_MODE_MII) {
+	if (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII) {
 		ethmode = LPC18XX_CREG_CREG6_ETHMODE_MII;
-	} else if (plat_dat->interface == PHY_INTERFACE_MODE_RMII) {
+	} else if (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) {
 		ethmode = LPC18XX_CREG_CREG6_ETHMODE_RMII;
 	} else {
 		dev_err(&pdev->dev, "Only MII and RMII mode supported\n");
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +1 -1
index 7580077383c0..cd796ec04132 100644
@@ -587,7 +587,7 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,
 {
 	int i;
 
-	plat->interface = priv_plat->phy_mode;
+	plat->mac_interface = priv_plat->phy_mode;
 	if (priv_plat->mac_wol)
 		plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
 	else
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +1 -1
index 7db176e8691f..9bf102bbc6a0 100644
@@ -236,7 +236,7 @@ static int socfpga_get_plat_phymode(struct socfpga_dwmac *dwmac)
 	struct net_device *ndev = dev_get_drvdata(dwmac->dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
 
-	return priv->plat->interface;
+	return priv->plat->mac_interface;
 }
 
 static void socfpga_sgmii_config(struct socfpga_dwmac *dwmac, bool enable)
drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +2 -2
index 892612564694..9289bb87c3e3 100644
@@ -60,7 +60,7 @@ static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat)
 	unsigned int mode;
 	int err;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		mode = STARFIVE_DWMAC_PHY_INFT_RMII;
 		break;
@@ -72,7 +72,7 @@ static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat)
 
 	default:
 		dev_err(dwmac->dev, "unsupported interface %d\n",
-			plat_dat->interface);
+			plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +4 -4
index 3a09085819dc..26ea8c687881 100644
@@ -171,7 +171,7 @@ static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat)
 
 	clk_rate = clk_get_rate(dwmac->clk_eth_ck);
 	dwmac->enable_eth_ck = false;
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		if (clk_rate == ETH_CK_F_25M && dwmac->ext_phyclk)
 			dwmac->enable_eth_ck = true;
@@ -210,7 +210,7 @@ static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat)
 		break;
 	default:
 		pr_debug("SYSCFG init :  Do not manage %d interface\n",
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		/* Do not manage others interfaces */
 		return -EINVAL;
 	}
@@ -230,7 +230,7 @@ static int stm32mcu_set_mode(struct plat_stmmacenet_data *plat_dat)
 	u32 reg = dwmac->mode_reg;
 	int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = SYSCFG_MCU_ETH_SEL_MII;
 		pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n");
@@ -241,7 +241,7 @@ static int stm32mcu_set_mode(struct plat_stmmacenet_data *plat_dat)
 		break;
 	default:
 		pr_debug("SYSCFG init :  Do not manage %d interface\n",
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		/* Do not manage others interfaces */
 		return -EINVAL;
 	}
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +3 -3
index c23420863a8d..01e77368eef1 100644
@@ -1016,7 +1016,7 @@ static int sun8i_dwmac_set_syscon(struct device *dev,
 	if (gmac->variant->support_rmii)
 		reg &= ~SYSCON_RMII_EN;
 
-	switch (plat->interface) {
+	switch (plat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		/* default */
 		break;
@@ -1031,7 +1031,7 @@ static int sun8i_dwmac_set_syscon(struct device *dev,
 		break;
 	default:
 		dev_err(dev, "Unsupported interface mode: %s",
-			phy_modes(plat->interface));
+			phy_modes(plat->mac_interface));
 		return -EINVAL;
 	}
 
@@ -1231,7 +1231,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
 	/* platform data specifying hardware features and callbacks.
 	 * hardware features were copied from Allwinner drivers.
 	 */
-	plat_dat->interface = interface;
+	plat_dat->mac_interface = interface;
 	plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
 	plat_dat->tx_coe = 1;
 	plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 -2
index e52ae165c968..c92bab6e2341 100644
@@ -1119,7 +1119,7 @@ static const struct phylink_mac_ops stmmac_phylink_mac_ops = {
  */
 static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
 {
-	int interface = priv->plat->interface;
+	int interface = priv->plat->mac_interface;
 
 	if (priv->dma_cap.pcs) {
 		if ((interface == PHY_INTERFACE_MODE_RGMII) ||
@@ -1214,7 +1214,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 		priv->phylink_config.ovr_an_inband =
 			mdio_bus_data->xpcs_an_inband;
 
-	/* Set the platform/firmware specified interface mode */
+	/* Set the platform/firmware specified interface mode. Note, phylink
+	 * deals with the PHY interface mode, not the MAC interface mode.
+	 */
 	__set_bit(mode, priv->phylink_config.supported_interfaces);
 
 	/* If we have an xpcs, it defines which PHY interfaces are supported. */
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -3
index ff330423ee66..35f4b1484029 100644
@@ -419,9 +419,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 		return ERR_PTR(phy_mode);
 
 	plat->phy_interface = phy_mode;
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+	plat->mac_interface = stmmac_of_get_mac_mode(np);
+	if (plat->mac_interface < 0)
+		plat->mac_interface = plat->phy_interface;
 
 	/* Some wrapper drivers still rely on phy_node. Let's save it while
 	 * they are not converted to phylink. */
include/linux/stmmac.h +14 -1
index b2ccd827bb80..ce89cc3e4913 100644
@@ -223,7 +223,20 @@ struct dwmac4_addrs {
 struct plat_stmmacenet_data {
 	int bus_id;
 	int phy_addr;
-	int interface;
+	/* MAC ----- optional PCS ----- SerDes ----- optional PHY ----- Media
+	 *       ^                               ^
+	 * mac_interface                   phy_interface
+	 *
+	 * mac_interface is the MAC-side interface, which may be the same
+	 * as phy_interface if there is no intervening PCS. If there is a
+	 * PCS, then mac_interface describes the interface mode between the
+	 * MAC and PCS, and phy_interface describes the interface mode
+	 * between the PCS and PHY.
+	 */
+	phy_interface_t mac_interface;
+	/* phy_interface is the PHY-side interface - the interface used by
+	 * an attached PHY.
+	 */
 	phy_interface_t phy_interface;
 	struct stmmac_mdio_bus_data *mdio_bus_data;
 	struct device_node *phy_node;
Signature · 1 line
2.30.2
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Sat, 26 Aug 2023 11:02:51 +0100 you wrote:

Clarify the difference between "interface" and "phy_interface" in struct plat_stmmacenet_data, both by adding a comment, and also renaming "interface" to be "mac_interface". The difference between these are:

MAC ----- optional PCS ----- SerDes ----- optional PHY ----- Media
^ ^
mac_interface phy_interface

[...]

Here is the summary with links:
- [net-next] net: stmmac: clarify difference between "interface" and "phy_interface"

    https://git.kernel.org/netdev/net-next/c/a014c35556b9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
In reply to Russell King (Oracle)

Hi Russel,

Am Samstag, 26. August 2023, 12:02:51 CEST schrieb Russell King (Oracle):

Quoted 75 lines

Clarify the difference between "interface" and "phy_interface" in struct plat_stmmacenet_data, both by adding a comment, and also renaming "interface" to be "mac_interface". The difference between these are:

MAC ----- optional PCS ----- SerDes ----- optional PHY ----- Media
^ ^
mac_interface phy_interface

Note that phylink currently only deals with phy_interface.

---

One last patch before Sunday - I would like to get this merged as it touches multiple stmmac platforms before any further are added.

This patch merely renames the "plat_dat->interface" to "->mac_interface" but doesn't change which any code uses.

All code which uses plat->interface (now plat->mac_interface) are determining the interface from the MAC side not the PHY side. These need a code review against the docs to check whether that is correct. Essentially, every .c file touched by this needs a code review. This code review should not affect whether this patch is merged.

 .../net/ethernet/stmicro/stmmac/dwmac-imx.c   | 14 ++++++-------
 .../ethernet/stmicro/stmmac/dwmac-ingenic.c   | 20 +++++++++----------
 .../ethernet/stmicro/stmmac/dwmac-loongson.c  |  2 +-
 .../ethernet/stmicro/stmmac/dwmac-lpc18xx.c   |  4 ++--
 .../ethernet/stmicro/stmmac/dwmac-mediatek.c  |  2 +-
 .../ethernet/stmicro/stmmac/dwmac-socfpga.c   |  2 +-
 .../ethernet/stmicro/stmmac/dwmac-starfive.c  |  4 ++--
 .../net/ethernet/stmicro/stmmac/dwmac-stm32.c |  8 ++++----
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c |  6 +++---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  6 ++++--
 .../ethernet/stmicro/stmmac/stmmac_platform.c |  6 +++---
 include/linux/stmmac.h                        | 15 +++++++++++++-
 12 files changed, 52 insertions(+), 37 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index 535856fffaea..df34e34cc14f 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0 -0
@@ -70,7 +70,7 @@ static int imx8mp_set_intf_mode(struct

plat_stmmacenet_data *plat_dat) struct imx_priv_data *dwmac = plat_dat->bsp_priv;

drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +2 -2
 	int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = GPR_ENET_QOS_INTF_SEL_MII;
 		break;
@@ -87,7 +87,7 @@ static int imx8mp_set_intf_mode(struct
 plat_stmmacenet_data *plat_dat) break;
 	default:
 		pr_debug("imx dwmac doesn't support %d interface\n",
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -110,7 +110,7 @@ static int imx93_set_intf_mode(struct

plat_stmmacenet_data *plat_dat) struct imx_priv_data *dwmac = plat_dat->bsp_priv;

drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +1 -1
 	int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = MX93_GPR_ENET_QOS_INTF_SEL_MII;
 		break;

drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c static int imx93_set_intf_mode(struct · line 127

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0 -0
@@ -125,7 +125,7 @@ static int imx93_set_intf_mode(struct
 plat_stmmacenet_data *plat_dat) break;
 	default:
 		dev_dbg(dwmac->dev, "imx dwmac doesn't support %d 

interface\n",

Quoted 31 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +4 -4
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		return -EINVAL;
 	}
 
@@ -192,8 +192,8 @@ static void imx_dwmac_fix_speed(void *priv, unsigned int
 speed, unsigned int mod plat_dat = dwmac->plat_dat;
 
 	if (dwmac->ops->mac_rgmii_txclk_auto_adj ||
-	    (plat_dat->interface == PHY_INTERFACE_MODE_RMII) ||
-	    (plat_dat->interface == PHY_INTERFACE_MODE_MII))
+	    (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) ||
+	    (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII))
 		return;
 
 	switch (speed) {
@@ -260,7 +260,7 @@ static int imx_dwmac_mx93_reset(void *priv, void __iomem
 *ioaddr) value |= DMA_BUS_MODE_SFT_RESET;
 	writel(value, ioaddr + DMA_BUS_MODE);
 
-	if (plat_dat->interface == PHY_INTERFACE_MODE_RMII) {
+	if (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) {
 		usleep_range(100, 200);
 		writel(RMII_RESET_SPEED, ioaddr + MAC_CTRL_REG);
 	}
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c index e22ef0d6bc73..0a20c3d24722 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c static int jz4775_mac_set_mode(struct plat_stmmacenet_data · line 94

Quoted 7 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
@@ -89,7 +89,7 @@ static int jz4775_mac_set_mode(struct plat_stmmacenet_data
 *plat_dat) struct ingenic_mac *mac = plat_dat->bsp_priv;
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = FIELD_PREP(MACPHYC_TXCLK_SEL_MASK, 

MACPHYC_TXCLK_SEL_INPUT) |

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c static int jz4775_mac_set_mode(struct plat_stmmacenet_data · line 95

Quoted 1 line
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +0 -0
 			  FIELD_PREP(MACPHYC_PHY_INFT_MASK, 

MACPHYC_PHY_INFT_MII);

Quoted 12 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
@@ -118,7 +118,7 @@ static int jz4775_mac_set_mode(struct
 plat_stmmacenet_data *plat_dat) break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 mac_interface);
 		return -EINVAL;
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +0 -0
 	}

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c static int x1000_mac_set_mode(struct · line 135

Quoted 7 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
@@ -130,13 +130,13 @@ static int x1000_mac_set_mode(struct
 plat_stmmacenet_data *plat_dat) {
 	struct ingenic_mac *mac = plat_dat->bsp_priv;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		dev_dbg(mac->dev, "MAC PHY Control Register: 

PHY_INTERFACE_MODE_RMII\n");

Quoted 13 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
 break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 mac_interface);
 		return -EINVAL;
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +0 -0
 	}
@@ -149,14 +149,14 @@ static int x1600_mac_set_mode(struct

plat_stmmacenet_data *plat_dat) struct ingenic_mac *mac = plat_dat->bsp_priv;

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c static int x1600_mac_set_mode(struct plat_stmmacenet_data *plat_dat)

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		val = FIELD_PREP(MACPHYC_PHY_INFT_MASK, 

MACPHYC_PHY_INFT_RMII);

Quoted 1 line

dev_dbg(mac->dev, "MAC PHY Control Register:

PHY_INTERFACE_MODE_RMII\n");

Quoted 13 lines

break;

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +0 -1
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat-

interface);

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -0
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat-

mac_interface);

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +0 -0
 		return -EINVAL;
 	}
@@ -169,7 +169,7 @@ static int x1830_mac_set_mode(struct

plat_stmmacenet_data *plat_dat) struct ingenic_mac *mac = plat_dat->bsp_priv;

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c static int x1600_mac_set_mode(struct plat_stmmacenet_data *plat_dat)

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		val = FIELD_PREP(MACPHYC_MODE_SEL_MASK, 

MACPHYC_MODE_SEL_RMII) |

Quoted 1 line

FIELD_PREP(MACPHYC_PHY_INFT_MASK,

MACPHYC_PHY_INFT_RMII);

Quoted 14 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
@@ -177,7 +177,7 @@ static int x1830_mac_set_mode(struct
 plat_stmmacenet_data *plat_dat) break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 mac_interface);
 		return -EINVAL;
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +0 -0
 	}
@@ -190,7 +190,7 @@ static int x2000_mac_set_mode(struct

plat_stmmacenet_data *plat_dat) struct ingenic_mac *mac = plat_dat->bsp_priv;

drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c static int x1600_mac_set_mode(struct plat_stmmacenet_data *plat_dat)

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
 	unsigned int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		val = FIELD_PREP(MACPHYC_TX_SEL_MASK, 

MACPHYC_TX_SEL_ORIGIN) |

Quoted 1 line

FIELD_PREP(MACPHYC_RX_SEL_MASK,

MACPHYC_RX_SEL_ORIGIN) |

Quoted 183 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +1 -1
@@ -220,7 +220,7 @@ static int x2000_mac_set_mode(struct
 plat_stmmacenet_data *plat_dat) break;
 
 	default:
-		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 interface);
+		dev_err(mac->dev, "Unsupported interface %d", plat_dat-
 mac_interface);
 		return -EINVAL;
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +0 -0
 	}
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c index a25c187d3185..2cd6fce5c993 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +1 -1
@@ -117,7 +117,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev,
 const struct pci_device_id }
 
 	plat->phy_interface = phy_mode;
-	plat->interface = PHY_INTERFACE_MODE_GMII;
+	plat->mac_interface = PHY_INTERFACE_MODE_GMII;
 
 	pci_set_master(pdev);
 
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c index 18e84ba693a6..d0aa674ce705 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c +2 -2
@@ -50,9 +50,9 @@ static int lpc18xx_dwmac_probe(struct platform_device
 *pdev) goto err_remove_config_dt;
 	}
 
-	if (plat_dat->interface == PHY_INTERFACE_MODE_MII) {
+	if (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII) {
 		ethmode = LPC18XX_CREG_CREG6_ETHMODE_MII;
-	} else if (plat_dat->interface == PHY_INTERFACE_MODE_RMII) {
+	} else if (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) {
 		ethmode = LPC18XX_CREG_CREG6_ETHMODE_RMII;
 	} else {
 		dev_err(&pdev->dev, "Only MII and RMII mode supported\n");
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c index 7580077383c0..cd796ec04132 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +1 -1
@@ -587,7 +587,7 @@ static int mediatek_dwmac_common_data(struct
 platform_device *pdev, {
 	int i;
 
-	plat->interface = priv_plat->phy_mode;
+	plat->mac_interface = priv_plat->phy_mode;
 	if (priv_plat->mac_wol)
 		plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
 	else
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 7db176e8691f..9bf102bbc6a0 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +1 -1
@@ -236,7 +236,7 @@ static int socfpga_get_plat_phymode(struct socfpga_dwmac
 *dwmac) struct net_device *ndev = dev_get_drvdata(dwmac->dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
 
-	return priv->plat->interface;
+	return priv->plat->mac_interface;
 }
 
 static void socfpga_sgmii_config(struct socfpga_dwmac *dwmac, bool enable)
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c index 892612564694..9289bb87c3e3 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +2 -2
@@ -60,7 +60,7 @@ static int starfive_dwmac_set_mode(struct
 plat_stmmacenet_data *plat_dat) unsigned int mode;
 	int err;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_RMII:
 		mode = STARFIVE_DWMAC_PHY_INFT_RMII;
 		break;
@@ -72,7 +72,7 @@ static int starfive_dwmac_set_mode(struct
 plat_stmmacenet_data *plat_dat)
 
 	default:
 		dev_err(dwmac->dev, "unsupported interface %d\n",
-			plat_dat->interface);
+			plat_dat->mac_interface);
 		return -EINVAL;
 	}
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index 3a09085819dc..26ea8c687881 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +1 -1
@@ -171,7 +171,7 @@ static int stm32mp1_set_mode(struct plat_stmmacenet_data
 *plat_dat)
 
 	clk_rate = clk_get_rate(dwmac->clk_eth_ck);
 	dwmac->enable_eth_ck = false;
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		if (clk_rate == ETH_CK_F_25M && dwmac->ext_phyclk)
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +3 -3
 			dwmac->enable_eth_ck = true;
@@ -210,7 +210,7 @@ static int stm32mp1_set_mode(struct plat_stmmacenet_data
 *plat_dat) break;
 	default:
 		pr_debug("SYSCFG init :  Do not manage %d interface\n",
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		/* Do not manage others interfaces */
 		return -EINVAL;
 	}
@@ -230,7 +230,7 @@ static int stm32mcu_set_mode(struct plat_stmmacenet_data
 *plat_dat) u32 reg = dwmac->mode_reg;
 	int val;
 
-	switch (plat_dat->interface) {
+	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = SYSCFG_MCU_ETH_SEL_MII;
 		pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n");
@@ -241,7 +241,7 @@ static int stm32mcu_set_mode(struct plat_stmmacenet_data
 *plat_dat) break;
 	default:
 		pr_debug("SYSCFG init :  Do not manage %d interface\n",
-			 plat_dat->interface);
+			 plat_dat->mac_interface);
 		/* Do not manage others interfaces */
 		return -EINVAL;
 	}
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index c23420863a8d..01e77368eef1 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +3 -3
@@ -1016,7 +1016,7 @@ static int sun8i_dwmac_set_syscon(struct device *dev,
 	if (gmac->variant->support_rmii)
 		reg &= ~SYSCON_RMII_EN;
 
-	switch (plat->interface) {
+	switch (plat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		/* default */
 		break;
@@ -1031,7 +1031,7 @@ static int sun8i_dwmac_set_syscon(struct device *dev,
 		break;
 	default:
 		dev_err(dev, "Unsupported interface mode: %s",
-			phy_modes(plat->interface));
+			phy_modes(plat->mac_interface));
 		return -EINVAL;
 	}
 
@@ -1231,7 +1231,7 @@ static int sun8i_dwmac_probe(struct platform_device
 *pdev) /* platform data specifying hardware features and callbacks.
 	 * hardware features were copied from Allwinner drivers.
 	 */
-	plat_dat->interface = interface;
+	plat_dat->mac_interface = interface;
 	plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
 	plat_dat->tx_coe = 1;
 	plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I;
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e52ae165c968..c92bab6e2341 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 -0
@@ -1119,7 +1119,7 @@ static const struct phylink_mac_ops

stmmac_phylink_mac_ops = { */
static void stmmac_check_pcs_mode(struct stmmac_priv *priv) {

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -1
-	int interface = priv->plat->interface;
+	int interface = priv->plat->mac_interface;
 
 	if (priv->dma_cap.pcs) {
 		if ((interface == PHY_INTERFACE_MODE_RGMII) ||

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c static int stmmac_phy_setup(struct stmmac_priv *priv) · line 1222

Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -1
@@ -1214,7 +1214,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 		priv->phylink_config.ovr_an_inband =
 			mdio_bus_data->xpcs_an_inband;
 
-	/* Set the platform/firmware specified interface mode */
+	/* Set the platform/firmware specified interface mode. Note, phylink
+	 * deals with the PHY interface mode, not the MAC interface mode.
+	 */
 	__set_bit(mode, priv->phylink_config.supported_interfaces);
 
 	/* If we have an xpcs, it defines which PHY interfaces are 

supported. */

Quoted 6 lines
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index ff330423ee66..35f4b1484029 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 · line 423

Quoted 8 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +2 -3
@@ -419,9 +419,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8
 *mac) return ERR_PTR(phy_mode);
 
 	plat->phy_interface = phy_mode;
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+	plat->mac_interface = stmmac_of_get_mac_mode(np);
+	if (plat->mac_interface < 0)

This check is never true as mac_interface is now an unsigned enum (phy_interface_t). Thus mac_interface is not set to phy_interface resulting in an invalid mac_interface. My platform (arch/arm64/boot/dts/freescale/imx8mp- tqma8mpql-mba8mpxl.dts) fails to probe now.

Best regards,
Alexander

Quoted 9 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +1 -0
+		plat->mac_interface = plat->phy_interface;
 
 	/* Some wrapper drivers still rely on phy_node. Let's save it while
 	 * they are not converted to phylink. */
include/linux/stmmac.h +0 -0
index b2ccd827bb80..ce89cc3e4913 100644

include/linux/stmmac.h struct dwmac4_addrs { · line 226

Quoted 5 lines
include/linux/stmmac.h +1 -1
@@ -223,7 +223,20 @@ struct dwmac4_addrs {
 struct plat_stmmacenet_data {
 	int bus_id;
 	int phy_addr;
-	int interface;
+	/* MAC ----- optional PCS ----- SerDes ----- optional PHY ----- 

Media

Quoted 16 lines
include/linux/stmmac.h +13 -0
+	 *       ^                               ^
+	 * mac_interface                   phy_interface
+	 *
+	 * mac_interface is the MAC-side interface, which may be the same
+	 * as phy_interface if there is no intervening PCS. If there is a
+	 * PCS, then mac_interface describes the interface mode between the
+	 * MAC and PCS, and phy_interface describes the interface mode
+	 * between the PCS and PHY.
+	 */
+	phy_interface_t mac_interface;
+	/* phy_interface is the PHY-side interface - the interface used by
+	 * an attached PHY.
+	 */
 	phy_interface_t phy_interface;
 	struct stmmac_mdio_bus_data *mdio_bus_data;
 	struct device_node *phy_node;
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
#3 lore raw
Quoted 8 lines · Alexander Stein
Quoted 8 lines
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index ff330423ee66..35f4b1484029 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -419,9 +419,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8
 *mac) return ERR_PTR(phy_mode);
 
Quoted 11 lines

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 · line 423

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +2 -3
 	plat->phy_interface = phy_mode;
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+	plat->mac_interface = stmmac_of_get_mac_mode(np);
+	if (plat->mac_interface < 0)

This check is never true as mac_interface is now an unsigned enum (phy_interface_t). Thus mac_interface is not set to phy_interface resulting in an invalid mac_interface. My platform (arch/arm64/boot/dts/freescale/imx8mp- tqma8mpql-mba8mpxl.dts) fails to probe now.

Thanks for catching that. Does this patch fix it for you?

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -3
index 231152ee5a32..0451d2c2aa43 100644
@@ -420,9 +420,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 		return ERR_PTR(phy_mode);
 
 	plat->phy_interface = phy_mode;
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+
+	rc = stmmac_of_get_mac_mode(np);
+	plat->interface = rc < 0 ? plat->phy_interface : rc;
 
 	/* Some wrapper drivers still rely on phy_node. Let's save it while
 	 * they are not converted to phylink. */
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!
#4 lore raw

Am Dienstag, 29. August 2023, 15:10:40 CEST schrieb Russell King (Oracle):

Quoted 32 lines · Alexander Stein
Quoted 11 lines
Quoted 11 lines
(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index ff330423ee66..35f4b1484029 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -419,9 +419,9 @@ stmmac_probe_config_dt(struct platform_device *pdev,

u8
*mac) return ERR_PTR(phy_mode);

plat->phy_interface = phy_mode;

Quoted 11 lines

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)

Quoted 5 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +2 -3
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+	plat->mac_interface = stmmac_of_get_mac_mode(np);
+	if (plat->mac_interface < 0)

This check is never true as mac_interface is now an unsigned enum (phy_interface_t). Thus mac_interface is not set to phy_interface resulting in an invalid mac_interface. My platform (arch/arm64/boot/dts/freescale/imx8mp- tqma8mpql-mba8mpxl.dts) fails to probe now.

Thanks for catching that. Does this patch fix it for you?

(quoted diff) +0 -0

b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 231152ee5a32..0451d2c2aa43 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 · line 425

Quoted 9 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -3
@@ -420,9 +420,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8
 *mac) return ERR_PTR(phy_mode);
 
 	plat->phy_interface = phy_mode;
-	plat->interface = stmmac_of_get_mac_mode(np);
-	if (plat->interface < 0)
-		plat->interface = plat->phy_interface;
+
+	rc = stmmac_of_get_mac_mode(np);
+	plat->interface = rc < 0 ? plat->phy_interface : rc;

I need to use plat->mac_interface on top of your patch. But despite that this fixes the probe error.

Thanks and best regards,
Alexander

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
 	/* Some wrapper drivers still rely on phy_node. Let's save it while
 	 * they are not converted to phylink. */
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/