linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/6] net: stmmac: use a local variable for priv->phylink_config
  2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
@ 2025-05-01 11:45 ` Russell King (Oracle)
  2025-05-01 12:10   ` Andrew Lunn
  2025-05-01 11:45 ` [PATCH net-next 2/6] net: stmmac: use priv->plat->phy_interface directly Russell King (Oracle)
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-01 11:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni

Use a local variable for priv->phylink_config in stmmac_phy_setup()
which makes the code a bit easier to read, allowing some lines to be
merged.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 37 +++++++++----------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f59a2363f150..fe7f9e3a92a5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1259,19 +1259,22 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 {
 	struct stmmac_mdio_bus_data *mdio_bus_data;
 	int mode = priv->plat->phy_interface;
+	struct phylink_config *config;
 	struct fwnode_handle *fwnode;
 	struct phylink_pcs *pcs;
 	struct phylink *phylink;
 
-	priv->phylink_config.dev = &priv->dev->dev;
-	priv->phylink_config.type = PHYLINK_NETDEV;
-	priv->phylink_config.mac_managed_pm = true;
+	config = &priv->phylink_config;
+
+	config->dev = &priv->dev->dev;
+	config->type = PHYLINK_NETDEV;
+	config->mac_managed_pm = true;
 
 	/* Stmmac always requires an RX clock for hardware initialization */
-	priv->phylink_config.mac_requires_rxc = true;
+	config->mac_requires_rxc = true;
 
 	if (!(priv->plat->flags & STMMAC_FLAG_RX_CLK_RUNS_IN_LPI))
-		priv->phylink_config.eee_rx_clk_stop_enable = true;
+		config->eee_rx_clk_stop_enable = true;
 
 	/* Set the default transmit clock stop bit based on the platform glue */
 	priv->tx_lpi_clk_stop = priv->plat->flags &
@@ -1279,13 +1282,12 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 
 	mdio_bus_data = priv->plat->mdio_bus_data;
 	if (mdio_bus_data)
-		priv->phylink_config.default_an_inband =
-			mdio_bus_data->default_an_inband;
+		config->default_an_inband = mdio_bus_data->default_an_inband;
 
 	/* 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);
+	__set_bit(mode, config->supported_interfaces);
 
 	/* If we have an xpcs, it defines which PHY interfaces are supported. */
 	if (priv->hw->xpcs)
@@ -1294,29 +1296,26 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 		pcs = priv->hw->phylink_pcs;
 
 	if (pcs)
-		phy_interface_or(priv->phylink_config.supported_interfaces,
-				 priv->phylink_config.supported_interfaces,
+		phy_interface_or(config->supported_interfaces,
+				 config->supported_interfaces,
 				 pcs->supported_interfaces);
 
 	if (priv->dma_cap.eee) {
 		/* Assume all supported interfaces also support LPI */
-		memcpy(priv->phylink_config.lpi_interfaces,
-		       priv->phylink_config.supported_interfaces,
-		       sizeof(priv->phylink_config.lpi_interfaces));
+		memcpy(config->lpi_interfaces, config->supported_interfaces,
+		       sizeof(config->lpi_interfaces));
 
 		/* All full duplex speeds above 100Mbps are supported */
-		priv->phylink_config.lpi_capabilities = ~(MAC_1000FD - 1) |
-							MAC_100FD;
-		priv->phylink_config.lpi_timer_default = eee_timer * 1000;
-		priv->phylink_config.eee_enabled_default = true;
+		config->lpi_capabilities = ~(MAC_1000FD - 1) | MAC_100FD;
+		config->lpi_timer_default = eee_timer * 1000;
+		config->eee_enabled_default = true;
 	}
 
 	fwnode = priv->plat->port_node;
 	if (!fwnode)
 		fwnode = dev_fwnode(priv->device);
 
-	phylink = phylink_create(&priv->phylink_config, fwnode,
-				 mode, &stmmac_phylink_mac_ops);
+	phylink = phylink_create(config, fwnode, mode, &stmmac_phylink_mac_ops);
 	if (IS_ERR(phylink))
 		return PTR_ERR(phylink);
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 2/6] net: stmmac: use priv->plat->phy_interface directly
  2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
  2025-05-01 11:45 ` [PATCH net-next 1/6] net: stmmac: use a local variable for priv->phylink_config Russell King (Oracle)
@ 2025-05-01 11:45 ` Russell King (Oracle)
  2025-05-01 12:11   ` Andrew Lunn
  2025-05-01 11:45 ` [PATCH net-next 3/6] net: stmmac: add get_interfaces() platform method Russell King (Oracle)
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-01 11:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni

Avoid using a local variable for priv->plat->phy_interface as this
may be modified in the .get_interfaces() method added in a future
commit.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fe7f9e3a92a5..ac6ab121eb33 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1258,7 +1258,6 @@ static int stmmac_init_phy(struct net_device *dev)
 static int stmmac_phy_setup(struct stmmac_priv *priv)
 {
 	struct stmmac_mdio_bus_data *mdio_bus_data;
-	int mode = priv->plat->phy_interface;
 	struct phylink_config *config;
 	struct fwnode_handle *fwnode;
 	struct phylink_pcs *pcs;
@@ -1287,7 +1286,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 	/* Set the platform/firmware specified interface mode. Note, phylink
 	 * deals with the PHY interface mode, not the MAC interface mode.
 	 */
-	__set_bit(mode, config->supported_interfaces);
+	__set_bit(priv->plat->phy_interface, config->supported_interfaces);
 
 	/* If we have an xpcs, it defines which PHY interfaces are supported. */
 	if (priv->hw->xpcs)
@@ -1315,7 +1314,8 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 	if (!fwnode)
 		fwnode = dev_fwnode(priv->device);
 
-	phylink = phylink_create(config, fwnode, mode, &stmmac_phylink_mac_ops);
+	phylink = phylink_create(config, fwnode, priv->plat->phy_interface,
+				 &stmmac_phylink_mac_ops);
 	if (IS_ERR(phylink))
 		return PTR_ERR(phylink);
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 3/6] net: stmmac: add get_interfaces() platform method
  2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
  2025-05-01 11:45 ` [PATCH net-next 1/6] net: stmmac: use a local variable for priv->phylink_config Russell King (Oracle)
  2025-05-01 11:45 ` [PATCH net-next 2/6] net: stmmac: use priv->plat->phy_interface directly Russell King (Oracle)
@ 2025-05-01 11:45 ` Russell King (Oracle)
  2025-05-01 11:45 ` [PATCH net-next 4/6] net: stmmac: intel: move phy_interface init to tgl_common_data() Russell King (Oracle)
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-01 11:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni

Add a get_interfaces() platform method to allow platforms to indicate
to phylink which interface modes they support - which then allows
phylink to validate on initialisation that the configured PHY interface
mode is actually supported.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c    | 16 +++++++++++++---
 include/linux/stmmac.h                           |  2 ++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index ac6ab121eb33..5f66f816a249 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1283,10 +1283,20 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
 	if (mdio_bus_data)
 		config->default_an_inband = mdio_bus_data->default_an_inband;
 
-	/* Set the platform/firmware specified interface mode. Note, phylink
-	 * deals with the PHY interface mode, not the MAC interface mode.
+	/* Get the PHY interface modes (at the PHY end of the link) that
+	 * are supported by the platform.
 	 */
-	__set_bit(priv->plat->phy_interface, config->supported_interfaces);
+	if (priv->plat->get_interfaces)
+		priv->plat->get_interfaces(priv, priv->plat->bsp_priv,
+					   config->supported_interfaces);
+
+	/* Set the platform/firmware specified interface mode if the
+	 * supported interfaces have not already been provided using
+	 * phy_interface as a last resort.
+	 */
+	if (phy_interface_empty(config->supported_interfaces))
+		__set_bit(priv->plat->phy_interface,
+			  config->supported_interfaces);
 
 	/* If we have an xpcs, it defines which PHY interfaces are supported. */
 	if (priv->hw->xpcs)
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 8aed09d65b4a..537bced69c46 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -233,6 +233,8 @@ struct plat_stmmacenet_data {
 	u8 tx_sched_algorithm;
 	struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES];
 	struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES];
+	void (*get_interfaces)(struct stmmac_priv *priv, void *bsp_priv,
+			       unsigned long *interfaces);
 	int (*set_clk_tx_rate)(void *priv, struct clk *clk_tx_i,
 			       phy_interface_t interface, int speed);
 	void (*fix_mac_speed)(void *priv, int speed, unsigned int mode);
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 4/6] net: stmmac: intel: move phy_interface init to tgl_common_data()
  2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
                   ` (2 preceding siblings ...)
  2025-05-01 11:45 ` [PATCH net-next 3/6] net: stmmac: add get_interfaces() platform method Russell King (Oracle)
@ 2025-05-01 11:45 ` Russell King (Oracle)
  2025-05-01 12:15   ` Andrew Lunn
  2025-05-01 11:45 ` [PATCH net-next 5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces() Russell King (Oracle)
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-01 11:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni

Move the initialisation of plat->phy_interface to tgl_common_data()
as all callers set this same interface mode. This moves it to a
single location to make the change to get_interfaces() more obvious.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index 96c893dd262f..4b263a3c65a4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -929,6 +929,7 @@ static int tgl_common_data(struct pci_dev *pdev,
 	plat->rx_queues_to_use = 6;
 	plat->tx_queues_to_use = 4;
 	plat->clk_ptp_rate = 204800000;
+	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 	plat->speed_mode_2500 = intel_speed_mode_2500;
 
 	plat->safety_feat_cfg->tsoee = 1;
@@ -948,7 +949,6 @@ static int tgl_sgmii_phy0_data(struct pci_dev *pdev,
 			       struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 	plat->serdes_powerup = intel_serdes_powerup;
 	plat->serdes_powerdown = intel_serdes_powerdown;
 	return tgl_common_data(pdev, plat);
@@ -962,7 +962,6 @@ static int tgl_sgmii_phy1_data(struct pci_dev *pdev,
 			       struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 2;
-	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 	plat->serdes_powerup = intel_serdes_powerup;
 	plat->serdes_powerdown = intel_serdes_powerdown;
 	return tgl_common_data(pdev, plat);
@@ -976,7 +975,6 @@ static int adls_sgmii_phy0_data(struct pci_dev *pdev,
 				struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 
 	/* SerDes power up and power down are done in BIOS for ADL */
 
@@ -991,7 +989,6 @@ static int adls_sgmii_phy1_data(struct pci_dev *pdev,
 				struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 2;
-	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 
 	/* SerDes power up and power down are done in BIOS for ADL */
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method
@ 2025-05-01 11:45 Russell King (Oracle)
  2025-05-01 11:45 ` [PATCH net-next 1/6] net: stmmac: use a local variable for priv->phylink_config Russell King (Oracle)
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-01 11:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni

Hi,

This series replaces the speed_mode_2500() method with a new method
that is more flexible, allowing the platform glue driver to populate
phylink's supported_interfaces and set the PHY-side interface mode.

The only user of this method is currently dwmac-intel, which we
update to use this new method.

 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 33 +++++++------
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h |  1 -
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 56 +++++++++++++----------
 include/linux/stmmac.h                            |  3 +-
 4 files changed, 49 insertions(+), 44 deletions(-)

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH net-next 5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces()
  2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
                   ` (3 preceding siblings ...)
  2025-05-01 11:45 ` [PATCH net-next 4/6] net: stmmac: intel: move phy_interface init to tgl_common_data() Russell King (Oracle)
@ 2025-05-01 11:45 ` Russell King (Oracle)
  2025-05-01 12:15   ` Andrew Lunn
  2025-05-01 11:45 ` [PATCH net-next 6/6] net: stmmac: remove speed_mode_2500() method Russell King (Oracle)
  2025-05-03  1:30 ` [PATCH net-next 0/6] net: stmmac: replace " patchwork-bot+netdevbpf
  6 siblings, 1 reply; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-01 11:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni

TGL platforms support either SGMII or 2500BASE-X, which is determined
by reading a SERDES register.

Thus, plat->phy_interface (and phylink's supported_interfaces) depend
on this. Use the new .get_interfaces() method to set both
plat->phy_interface and the supported_interfaces bitmap.

This removes the only user of the .speed_mode_2500() method.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 30 ++++++++++---------
 .../net/ethernet/stmicro/stmmac/dwmac-intel.h |  1 -
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index 4b263a3c65a4..9a47015254bb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -284,25 +284,28 @@ static void intel_serdes_powerdown(struct net_device *ndev, void *intel_data)
 	}
 }
 
-static void intel_speed_mode_2500(struct net_device *ndev, void *intel_data)
+static void tgl_get_interfaces(struct stmmac_priv *priv, void *bsp_priv,
+			       unsigned long *interfaces)
 {
-	struct intel_priv_data *intel_priv = intel_data;
-	struct stmmac_priv *priv = netdev_priv(ndev);
-	int serdes_phy_addr = 0;
-	u32 data = 0;
-
-	serdes_phy_addr = intel_priv->mdio_adhoc_addr;
+	struct intel_priv_data *intel_priv = bsp_priv;
+	phy_interface_t interface;
+	int data;
 
 	/* Determine the link speed mode: 2.5Gbps/1Gbps */
-	data = mdiobus_read(priv->mii, serdes_phy_addr,
-			    SERDES_GCR);
+	data = mdiobus_read(priv->mii, intel_priv->mdio_adhoc_addr, SERDES_GCR);
+	if (data < 0)
+		return;
 
-	if (((data & SERDES_LINK_MODE_MASK) >> SERDES_LINK_MODE_SHIFT) ==
-	    SERDES_LINK_MODE_2G5) {
+	if (FIELD_GET(SERDES_LINK_MODE_MASK, data) == SERDES_LINK_MODE_2G5) {
 		dev_info(priv->device, "Link Speed Mode: 2.5Gbps\n");
-		priv->plat->phy_interface = PHY_INTERFACE_MODE_2500BASEX;
 		priv->plat->mdio_bus_data->default_an_inband = false;
+		interface = PHY_INTERFACE_MODE_2500BASEX;
+	} else {
+		interface = PHY_INTERFACE_MODE_SGMII;
 	}
+
+	__set_bit(interface, interfaces);
+	priv->plat->phy_interface = interface;
 }
 
 /* Program PTP Clock Frequency for different variant of
@@ -929,8 +932,7 @@ static int tgl_common_data(struct pci_dev *pdev,
 	plat->rx_queues_to_use = 6;
 	plat->tx_queues_to_use = 4;
 	plat->clk_ptp_rate = 204800000;
-	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
-	plat->speed_mode_2500 = intel_speed_mode_2500;
+	plat->get_interfaces = tgl_get_interfaces;
 
 	plat->safety_feat_cfg->tsoee = 1;
 	plat->safety_feat_cfg->mrxpee = 0;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h
index a12f8e65f89f..7511c224b312 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h
@@ -21,7 +21,6 @@
 #define SERDES_RATE_MASK	GENMASK(9, 8)
 #define SERDES_PCLK_MASK	GENMASK(14, 12)	/* PCLK rate to PHY */
 #define SERDES_LINK_MODE_MASK	GENMASK(2, 1)
-#define SERDES_LINK_MODE_SHIFT	1
 #define SERDES_PWR_ST_SHIFT	4
 #define SERDES_PWR_ST_P0	0x0
 #define SERDES_PWR_ST_P3	0x3
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 6/6] net: stmmac: remove speed_mode_2500() method
  2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
                   ` (4 preceding siblings ...)
  2025-05-01 11:45 ` [PATCH net-next 5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces() Russell King (Oracle)
@ 2025-05-01 11:45 ` Russell King (Oracle)
  2025-05-01 12:16   ` Andrew Lunn
  2025-05-03  1:30 ` [PATCH net-next 0/6] net: stmmac: replace " patchwork-bot+netdevbpf
  6 siblings, 1 reply; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-01 11:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni

Remove the speed_mode_2500() platform method which is no longer used
or necessary, being superseded by the more flexible get_interfaces()
method.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ---
 include/linux/stmmac.h                            | 1 -
 2 files changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 5f66f816a249..28b62bd73e23 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7736,9 +7736,6 @@ int stmmac_dvr_probe(struct device *device,
 		goto error_mdio_register;
 	}
 
-	if (priv->plat->speed_mode_2500)
-		priv->plat->speed_mode_2500(ndev, priv->plat->bsp_priv);
-
 	ret = stmmac_pcs_setup(ndev);
 	if (ret)
 		goto error_pcs_setup;
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 537bced69c46..26ddf95d23f9 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -241,7 +241,6 @@ struct plat_stmmacenet_data {
 	int (*fix_soc_reset)(void *priv, void __iomem *ioaddr);
 	int (*serdes_powerup)(struct net_device *ndev, void *priv);
 	void (*serdes_powerdown)(struct net_device *ndev, void *priv);
-	void (*speed_mode_2500)(struct net_device *ndev, void *priv);
 	int (*mac_finish)(struct net_device *ndev,
 			  void *priv,
 			  unsigned int mode,
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 1/6] net: stmmac: use a local variable for priv->phylink_config
  2025-05-01 11:45 ` [PATCH net-next 1/6] net: stmmac: use a local variable for priv->phylink_config Russell King (Oracle)
@ 2025-05-01 12:10   ` Andrew Lunn
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-05-01 12:10 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, Alexandre Torgue, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, linux-arm-kernel, linux-stm32,
	Maxime Coquelin, netdev, Paolo Abeni

On Thu, May 01, 2025 at 12:45:01PM +0100, Russell King (Oracle) wrote:
> Use a local variable for priv->phylink_config in stmmac_phy_setup()
> which makes the code a bit easier to read, allowing some lines to be
> merged.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 2/6] net: stmmac: use priv->plat->phy_interface directly
  2025-05-01 11:45 ` [PATCH net-next 2/6] net: stmmac: use priv->plat->phy_interface directly Russell King (Oracle)
@ 2025-05-01 12:11   ` Andrew Lunn
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-05-01 12:11 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, Alexandre Torgue, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, linux-arm-kernel, linux-stm32,
	Maxime Coquelin, netdev, Paolo Abeni

On Thu, May 01, 2025 at 12:45:06PM +0100, Russell King (Oracle) wrote:
> Avoid using a local variable for priv->plat->phy_interface as this
> may be modified in the .get_interfaces() method added in a future
> commit.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces()
  2025-05-01 11:45 ` [PATCH net-next 5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces() Russell King (Oracle)
@ 2025-05-01 12:15   ` Andrew Lunn
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-05-01 12:15 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, Alexandre Torgue, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, linux-arm-kernel, linux-stm32,
	Maxime Coquelin, netdev, Paolo Abeni

On Thu, May 01, 2025 at 12:45:21PM +0100, Russell King (Oracle) wrote:
> TGL platforms support either SGMII or 2500BASE-X, which is determined
> by reading a SERDES register.
> 
> Thus, plat->phy_interface (and phylink's supported_interfaces) depend
> on this. Use the new .get_interfaces() method to set both
> plat->phy_interface and the supported_interfaces bitmap.
> 
> This removes the only user of the .speed_mode_2500() method.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 4/6] net: stmmac: intel: move phy_interface init to tgl_common_data()
  2025-05-01 11:45 ` [PATCH net-next 4/6] net: stmmac: intel: move phy_interface init to tgl_common_data() Russell King (Oracle)
@ 2025-05-01 12:15   ` Andrew Lunn
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-05-01 12:15 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, Alexandre Torgue, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, linux-arm-kernel, linux-stm32,
	Maxime Coquelin, netdev, Paolo Abeni

On Thu, May 01, 2025 at 12:45:16PM +0100, Russell King (Oracle) wrote:
> Move the initialisation of plat->phy_interface to tgl_common_data()
> as all callers set this same interface mode. This moves it to a
> single location to make the change to get_interfaces() more obvious.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 6/6] net: stmmac: remove speed_mode_2500() method
  2025-05-01 11:45 ` [PATCH net-next 6/6] net: stmmac: remove speed_mode_2500() method Russell King (Oracle)
@ 2025-05-01 12:16   ` Andrew Lunn
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-05-01 12:16 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, Alexandre Torgue, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, linux-arm-kernel, linux-stm32,
	Maxime Coquelin, netdev, Paolo Abeni

On Thu, May 01, 2025 at 12:45:27PM +0100, Russell King (Oracle) wrote:
> Remove the speed_mode_2500() platform method which is no longer used
> or necessary, being superseded by the more flexible get_interfaces()
> method.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method
  2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
                   ` (5 preceding siblings ...)
  2025-05-01 11:45 ` [PATCH net-next 6/6] net: stmmac: remove speed_mode_2500() method Russell King (Oracle)
@ 2025-05-03  1:30 ` patchwork-bot+netdevbpf
  2025-05-03  8:59   ` Russell King (Oracle)
  6 siblings, 1 reply; 15+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-03  1:30 UTC (permalink / raw)
  To: Russell King
  Cc: andrew, hkallweit1, alexandre.torgue, andrew+netdev, davem,
	edumazet, kuba, linux-arm-kernel, linux-stm32, mcoquelin.stm32,
	netdev, pabeni

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 1 May 2025 12:45:21 +0100 you wrote:
> Hi,
> 
> This series replaces the speed_mode_2500() method with a new method
> that is more flexible, allowing the platform glue driver to populate
> phylink's supported_interfaces and set the PHY-side interface mode.
> 
> The only user of this method is currently dwmac-intel, which we
> update to use this new method.
> 
> [...]

Here is the summary with links:
  - [net-next,1/6] net: stmmac: use a local variable for priv->phylink_config
    https://git.kernel.org/netdev/net-next/c/5ad39ceaea00
  - [net-next,2/6] net: stmmac: use priv->plat->phy_interface directly
    https://git.kernel.org/netdev/net-next/c/1966be55da5b
  - [net-next,3/6] net: stmmac: add get_interfaces() platform method
    https://git.kernel.org/netdev/net-next/c/ca732e990fc8
  - [net-next,4/6] net: stmmac: intel: move phy_interface init to tgl_common_data()
    https://git.kernel.org/netdev/net-next/c/0f455d2d1bbe
  - [net-next,5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces()
    https://git.kernel.org/netdev/net-next/c/d3836052fe09
  - [net-next,6/6] net: stmmac: remove speed_mode_2500() method
    https://git.kernel.org/netdev/net-next/c/9d165dc58055

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method
  2025-05-03  1:30 ` [PATCH net-next 0/6] net: stmmac: replace " patchwork-bot+netdevbpf
@ 2025-05-03  8:59   ` Russell King (Oracle)
  2025-05-03  9:01     ` Russell King (Oracle)
  0 siblings, 1 reply; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-03  8:59 UTC (permalink / raw)
  To: patchwork-bot+netdevbpf
  Cc: andrew, hkallweit1, alexandre.torgue, andrew+netdev, davem,
	edumazet, kuba, linux-arm-kernel, linux-stm32, mcoquelin.stm32,
	netdev, pabeni

Err, I sent v2 a couple of days ago, did patchwork not see it?

On Sat, May 03, 2025 at 01:30:36AM +0000, patchwork-bot+netdevbpf@kernel.org wrote:
> Hello:
> 
> This series was applied to netdev/net-next.git (main)
> by Jakub Kicinski <kuba@kernel.org>:
> 
> On Thu, 1 May 2025 12:45:21 +0100 you wrote:
> > Hi,
> > 
> > This series replaces the speed_mode_2500() method with a new method
> > that is more flexible, allowing the platform glue driver to populate
> > phylink's supported_interfaces and set the PHY-side interface mode.
> > 
> > The only user of this method is currently dwmac-intel, which we
> > update to use this new method.
> > 
> > [...]
> 
> Here is the summary with links:
>   - [net-next,1/6] net: stmmac: use a local variable for priv->phylink_config
>     https://git.kernel.org/netdev/net-next/c/5ad39ceaea00
>   - [net-next,2/6] net: stmmac: use priv->plat->phy_interface directly
>     https://git.kernel.org/netdev/net-next/c/1966be55da5b
>   - [net-next,3/6] net: stmmac: add get_interfaces() platform method
>     https://git.kernel.org/netdev/net-next/c/ca732e990fc8
>   - [net-next,4/6] net: stmmac: intel: move phy_interface init to tgl_common_data()
>     https://git.kernel.org/netdev/net-next/c/0f455d2d1bbe
>   - [net-next,5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces()
>     https://git.kernel.org/netdev/net-next/c/d3836052fe09
>   - [net-next,6/6] net: stmmac: remove speed_mode_2500() method
>     https://git.kernel.org/netdev/net-next/c/9d165dc58055
> 
> You are awesome, thank you!
> -- 
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
> 
> 
> 

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method
  2025-05-03  8:59   ` Russell King (Oracle)
@ 2025-05-03  9:01     ` Russell King (Oracle)
  0 siblings, 0 replies; 15+ messages in thread
From: Russell King (Oracle) @ 2025-05-03  9:01 UTC (permalink / raw)
  To: patchwork-bot+netdevbpf
  Cc: andrew, hkallweit1, alexandre.torgue, andrew+netdev, davem,
	edumazet, kuba, linux-arm-kernel, linux-stm32, mcoquelin.stm32,
	netdev, pabeni

Ignore me, not enough coffee. Sorry for the noise.

On Sat, May 03, 2025 at 09:59:48AM +0100, Russell King (Oracle) wrote:
> Err, I sent v2 a couple of days ago, did patchwork not see it?
> 
> On Sat, May 03, 2025 at 01:30:36AM +0000, patchwork-bot+netdevbpf@kernel.org wrote:
> > Hello:
> > 
> > This series was applied to netdev/net-next.git (main)
> > by Jakub Kicinski <kuba@kernel.org>:
> > 
> > On Thu, 1 May 2025 12:45:21 +0100 you wrote:
> > > Hi,
> > > 
> > > This series replaces the speed_mode_2500() method with a new method
> > > that is more flexible, allowing the platform glue driver to populate
> > > phylink's supported_interfaces and set the PHY-side interface mode.
> > > 
> > > The only user of this method is currently dwmac-intel, which we
> > > update to use this new method.
> > > 
> > > [...]
> > 
> > Here is the summary with links:
> >   - [net-next,1/6] net: stmmac: use a local variable for priv->phylink_config
> >     https://git.kernel.org/netdev/net-next/c/5ad39ceaea00
> >   - [net-next,2/6] net: stmmac: use priv->plat->phy_interface directly
> >     https://git.kernel.org/netdev/net-next/c/1966be55da5b
> >   - [net-next,3/6] net: stmmac: add get_interfaces() platform method
> >     https://git.kernel.org/netdev/net-next/c/ca732e990fc8
> >   - [net-next,4/6] net: stmmac: intel: move phy_interface init to tgl_common_data()
> >     https://git.kernel.org/netdev/net-next/c/0f455d2d1bbe
> >   - [net-next,5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces()
> >     https://git.kernel.org/netdev/net-next/c/d3836052fe09
> >   - [net-next,6/6] net: stmmac: remove speed_mode_2500() method
> >     https://git.kernel.org/netdev/net-next/c/9d165dc58055
> > 
> > You are awesome, thank you!
> > -- 
> > Deet-doot-dot, I am a bot.
> > https://korg.docs.kernel.org/patchwork/pwbot.html
> > 
> > 
> > 
> 
> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-05-03  9:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-01 11:45 [PATCH net-next 0/6] net: stmmac: replace speed_mode_2500() method Russell King (Oracle)
2025-05-01 11:45 ` [PATCH net-next 1/6] net: stmmac: use a local variable for priv->phylink_config Russell King (Oracle)
2025-05-01 12:10   ` Andrew Lunn
2025-05-01 11:45 ` [PATCH net-next 2/6] net: stmmac: use priv->plat->phy_interface directly Russell King (Oracle)
2025-05-01 12:11   ` Andrew Lunn
2025-05-01 11:45 ` [PATCH net-next 3/6] net: stmmac: add get_interfaces() platform method Russell King (Oracle)
2025-05-01 11:45 ` [PATCH net-next 4/6] net: stmmac: intel: move phy_interface init to tgl_common_data() Russell King (Oracle)
2025-05-01 12:15   ` Andrew Lunn
2025-05-01 11:45 ` [PATCH net-next 5/6] net: stmmac: intel: convert speed_mode_2500() to get_interfaces() Russell King (Oracle)
2025-05-01 12:15   ` Andrew Lunn
2025-05-01 11:45 ` [PATCH net-next 6/6] net: stmmac: remove speed_mode_2500() method Russell King (Oracle)
2025-05-01 12:16   ` Andrew Lunn
2025-05-03  1:30 ` [PATCH net-next 0/6] net: stmmac: replace " patchwork-bot+netdevbpf
2025-05-03  8:59   ` Russell King (Oracle)
2025-05-03  9:01     ` Russell King (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).