Skip to contentSkip to conversation

net: phy: rename eee_broken_mode

PATCH Applied Heiner Kallweit 3 participants 6 messages Feb 10, 2025 – Feb 11, 2025

Subsystems (4)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

cover net: phy: rename eee_broken_mode

eee_broken_mode is used also if an EEE mode isn't actually broken but e.g. not supported by MAC. So rename it.

This is split out from a bigger series that needs more rework.

Heiner Kallweit (2):
net: phy: rename eee_broken_modes to eee_disabled_modes
net: phy: rename phy_set_eee_broken to phy_disable_eee_mode

 drivers/net/ethernet/realtek/r8169_main.c |  6 +++---
 drivers/net/phy/phy-c45.c                 |  2 +-
 drivers/net/phy/phy-core.c                |  2 +-
 drivers/net/phy/phy_device.c              |  2 +-
 include/linux/phy.h                       | 12 ++++++------
 5 files changed, 12 insertions(+), 12 deletions(-)
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH 1/2 net: phy: rename eee_broken_modes to eee_disabled_modes

This bitmap is used also if the MAC doesn't support an EEE mode. So the mode isn't necessarily broken in the PHY. Therefore rename the bitmap.

---
 drivers/net/phy/phy-c45.c    | 2 +-
 drivers/net/phy/phy-core.c   | 2 +-
 drivers/net/phy/phy_device.c | 2 +-
 include/linux/phy.h          | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/phy/phy-c45.c +1 -1
index 0dac08e85..468d24611 100644
@@ -686,7 +686,7 @@ static int genphy_c45_write_eee_adv(struct phy_device *phydev,
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(tmp);
 	int val, changed = 0;
 
-	linkmode_andnot(tmp, adv, phydev->eee_broken_modes);
+	linkmode_andnot(tmp, adv, phydev->eee_disabled_modes);
 
 	if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) {
 		val = linkmode_to_mii_eee_cap1_t(tmp);
drivers/net/phy/phy-core.c +1 -1
index f181f05cb..2fd1d153a 100644
@@ -406,7 +406,7 @@ void of_set_phy_supported(struct phy_device *phydev)
 void of_set_phy_eee_broken(struct phy_device *phydev)
 {
 	struct device_node *node = phydev->mdio.dev.of_node;
-	unsigned long *modes = phydev->eee_broken_modes;
+	unsigned long *modes = phydev->eee_disabled_modes;
 
 	if (!IS_ENABLED(CONFIG_OF_MDIO) || !node)
 		return;
drivers/net/phy/phy_device.c +1 -1
index 46713d274..9b06ba92f 100644
@@ -2966,7 +2966,7 @@ void phy_disable_eee(struct phy_device *phydev)
 	phydev->eee_cfg.tx_lpi_enabled = false;
 	phydev->eee_cfg.eee_enabled = false;
 	/* don't let userspace re-enable EEE advertisement */
-	linkmode_fill(phydev->eee_broken_modes);
+	linkmode_fill(phydev->eee_disabled_modes);
 }
 EXPORT_SYMBOL_GPL(phy_disable_eee);
 
include/linux/phy.h +3 -3
index 19f076a71..dbc7e7245 100644
@@ -611,7 +611,7 @@ struct macsec_ops;
  * @eee_cfg: User configuration of EEE
  * @lp_advertising: Current link partner advertised linkmodes
  * @host_interfaces: PHY interface modes supported by host
- * @eee_broken_modes: Energy efficient ethernet modes which should be prohibited
+ * @eee_disabled_modes: Energy efficient ethernet modes not to be advertised
  * @autoneg: Flag autoneg being used
  * @rate_matching: Current rate matching mode
  * @link: Current link state
@@ -727,7 +727,7 @@ struct phy_device {
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(supported_eee);
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising_eee);
 	/* Energy efficient ethernet modes which should be prohibited */
-	__ETHTOOL_DECLARE_LINK_MODE_MASK(eee_broken_modes);
+	__ETHTOOL_DECLARE_LINK_MODE_MASK(eee_disabled_modes);
 	bool enable_tx_lpi;
 	bool eee_active;
 	struct eee_config eee_cfg;
@@ -1353,7 +1353,7 @@ int phy_speed_down_core(struct phy_device *phydev);
  */
 static inline void phy_set_eee_broken(struct phy_device *phydev, u32 link_mode)
 {
-	linkmode_set_bit(link_mode, phydev->eee_broken_modes);
+	linkmode_set_bit(link_mode, phydev->eee_disabled_modes);
 }
 
 /**
Signature · 1 line
2.48.1
author maintainer
#3 lore raw

PATCH 2/2 net: phy: rename phy_set_eee_broken to phy_disable_eee_mode

In reply to Heiner Kallweit

Consider that an EEE mode may not be broken but simply not supported by the MAC, and rename function phy_set_eee_broken().

---
 drivers/net/ethernet/realtek/r8169_main.c | 6 +++---
 include/linux/phy.h                       | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +3 -3
index 7306c8e32..32eb4a448 100644
@@ -5252,9 +5252,9 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
 
 	/* mimic behavior of r8125/r8126 vendor drivers */
 	if (tp->mac_version == RTL_GIGA_MAC_VER_61)
-		phy_set_eee_broken(tp->phydev,
-				   ETHTOOL_LINK_MODE_2500baseT_Full_BIT);
-	phy_set_eee_broken(tp->phydev, ETHTOOL_LINK_MODE_5000baseT_Full_BIT);
+		phy_disable_eee_mode(tp->phydev,
+				     ETHTOOL_LINK_MODE_2500baseT_Full_BIT);
+	phy_disable_eee_mode(tp->phydev, ETHTOOL_LINK_MODE_5000baseT_Full_BIT);
 
 	/* PHY will be woken up in rtl_open() */
 	phy_suspend(tp->phydev);
include/linux/phy.h +3 -3
index dbc7e7245..29df4c602 100644
@@ -1347,11 +1347,11 @@ void of_set_phy_timing_role(struct phy_device *phydev);
 int phy_speed_down_core(struct phy_device *phydev);
 
 /**
- * phy_set_eee_broken - Mark an EEE mode as broken so that it isn't advertised.
+ * phy_disable_eee_mode - Don't advertise an EEE mode.
  * @phydev: The phy_device struct
- * @link_mode: The broken EEE mode
+ * @link_mode: The EEE mode to be disabled
  */
-static inline void phy_set_eee_broken(struct phy_device *phydev, u32 link_mode)
+static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode)
 {
 	linkmode_set_bit(link_mode, phydev->eee_disabled_modes);
 }
Signature · 1 line
2.48.1
#5 lore raw
In reply to Heiner Kallweit
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 10 lines · On Mon, 10 Feb 2025 21:48:42 +0100 you wrote:

eee_broken_mode is used also if an EEE mode isn't actually broken but e.g. not supported by MAC. So rename it.

This is split out from a bigger series that needs more rework.

Heiner Kallweit (2):
net: phy: rename eee_broken_modes to eee_disabled_modes
net: phy: rename phy_set_eee_broken to phy_disable_eee_mode

[...]

Here is the summary with links:
- [net-next,1/2] net: phy: rename eee_broken_modes to eee_disabled_modes

    https://git.kernel.org/netdev/net-next/c/8eb0d381be31
  - [net-next,2/2] net: phy: rename phy_set_eee_broken to phy_disable_eee_mode
    https://git.kernel.org/netdev/net-next/c/5e7a74b6a357

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html