Skip to contentSkip to conversation

amd-xgbe: let the MAC manage PHY PM

PATCH Superseded Raju Rangoju 2 participants 3 messages Nov 19, 2025 – Nov 21, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Raju Rangoju

author maintainer
#0 lore raw

PATCH 1/1 amd-xgbe: let the MAC manage PHY PM

Use the MAC managed PM flag to indicate that MAC driver takes care of suspending/resuming the PHY, and reset it when the device is brought up.

---
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c    | 3 +++
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 1 +
 2 files changed, 4 insertions(+)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +3 -0
index f3adf29b222b..1c03fb138ce6 100644
@@ -1266,6 +1266,9 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
 
 	clear_bit(XGBE_STOPPED, &pdata->dev_state);
 
+	/* Reset the phy settings */
+	xgbe_phy_reset(pdata);
+
 	return 0;
 
 err_irqs:
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +1 -0
index 35a381a83647..a68757e8fd22 100644
@@ -989,6 +989,7 @@ static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)
 		return ret;
 	}
 	phy_data->phydev = phydev;
+	phy_data->phydev->mac_managed_pm = true;
 
 	xgbe_phy_external_phy_quirks(pdata);
 
Signature · 1 line
2.34.1
#1 lore raw

Hi Raju,

Quoted 14 lines · Raju Rangoju

Use the MAC managed PM flag to indicate that MAC driver takes care of suspending/resuming the PHY, and reset it when the device is brought up.

---
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c    | 3 +++
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 1 +
 2 files changed, 4 insertions(+)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +0 -0
index f3adf29b222b..1c03fb138ce6 100644

drivers/net/ethernet/amd/xgbe/xgbe-drv.c static int xgbe_start(struct xgbe_prv_data *pdata) · line 1271

Quoted 6 lines
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +3 -0
@@ -1266,6 +1266,9 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
 
 	clear_bit(XGBE_STOPPED, &pdata->dev_state);
 
+	/* Reset the phy settings */
+	xgbe_phy_reset(pdata);
+

At a first glance, this looks like 2 different things, so maybe 2 different patches ?

That said, with this change does it still make sense to call xgbe_phy_reset() in xgbe_open() ?

With this patch we have :

xgpe_open() {

  xgbe_phy_reset();
  xgbe_start() {
    xgbe_phy_reset(); /* again */

}
}

Can you remove the first call in .ndo_open ?

Maxime

author maintainer
#2 lore raw
Quoted 21 lines · Maxime Chevallier

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

Hi Raju,

Quoted 15 lines · Raju Rangoju

Use the MAC managed PM flag to indicate that MAC driver takes care of suspending/resuming the PHY, and reset it when the device is brought up.

---
  drivers/net/ethernet/amd/xgbe/xgbe-drv.c    | 3 +++
  drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 1 +
  2 files changed, 4 insertions(+)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +0 -0
index f3adf29b222b..1c03fb138ce6 100644
@@ -1266,6 +1266,9 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
 
Quoted 9 lines

drivers/net/ethernet/amd/xgbe/xgbe-drv.c static int xgbe_start(struct xgbe_prv_data *pdata) · line 1271

Quoted 5 lines
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +3 -0
       clear_bit(XGBE_STOPPED, &pdata->dev_state);
 
+     /* Reset the phy settings */
+     xgbe_phy_reset(pdata);
+

At a first glance, this looks like 2 different things, so maybe 2 different patches ?

Hi Maxime,

Patch is setting MAC managed PM flag and moving the reset to appropriate place. Do you see a need for separate patch for this?

Quoted 2 lines

That said, with this change does it still make sense to call xgbe_phy_reset() in xgbe_open() ?

No, calling it in xgbe_open() isn't needed.

Quoted 5 lines

With this patch we have :

xgpe_open() {

Quoted 8 lines
   xgbe_phy_reset();
   xgbe_start() {
     xgbe_phy_reset(); /* again */
   }
}

Can you remove the first call in .ndo_open ?

sure, I'll take of this in V2.

Quoted 3 lines

Maxime