Skip to contentSkip to conversation

net:phy:dp83867: set up rgmii tx delay

PATCH In review Max Uvarov 2 participants 3 messages May 24, 2019

Subsystems (3)
lore
Share & tools
lore

Max Uvarov

author
#0 lore raw

PATCH 1/1 net:phy:dp83867: set up rgmii tx delay

PHY_INTERFACE_MODE_RGMII_RXID is less then TXID
so code to set tx delay is never called.

---
 drivers/net/phy/dp83867.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/phy/dp83867.c +1 -3
index 2984fd5ae495..5fed837665ea 100644
@@ -251,10 +251,8 @@ static int dp83867_config_init(struct phy_device *phydev)
 		ret = phy_write(phydev, MII_DP83867_PHYCTRL, val);
 		if (ret)
 			return ret;
-	}
 
-	if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) &&
-	    (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
+		/* Set up RGMII delays */
 		val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL);
 
 		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Max Uvarov

PHY_INTERFACE_MODE_RGMII_RXID is less then TXID
so code to set tx delay is never called.

Could you provide an appropriate Fixes: tag for this as well as fix the subject to be:

net: phy: dp83867: Set up RGMII TX delay

(sorry for being uber nitpicking on this)

Quoted 9 lines
---
 drivers/net/phy/dp83867.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/phy/dp83867.c +0 -0
index 2984fd5ae495..5fed837665ea 100644

drivers/net/phy/dp83867.c static int dp83867_config_init(struct phy_device *phydev) · line 254

Quoted 5 lines
drivers/net/phy/dp83867.c +0 -1
@@ -251,10 +251,8 @@ static int dp83867_config_init(struct phy_device *phydev)
 		ret = phy_write(phydev, MII_DP83867_PHYCTRL, val);
 		if (ret)
 			return ret;
-	}
 

Is this hunk ^ intentional?

Quoted 7 lines
drivers/net/phy/dp83867.c +1 -2
-	if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) &&
-	    (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
+		/* Set up RGMII delays */
 		val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL);
 
 		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
Signature · 1 line
Florian
#2 lore raw

пт, 24 мая 2019 г. в 17:37, Florian Fainelli <[email protected]>:

Quoted 20 lines · Max Uvarov
Quoted 4 lines

PHY_INTERFACE_MODE_RGMII_RXID is less then TXID
so code to set tx delay is never called.

Could you provide an appropriate Fixes: tag for this as well as fix the subject to be:

net: phy: dp83867: Set up RGMII TX delay

(sorry for being uber nitpicking on this)

Quoted 4 lines
---
 drivers/net/phy/dp83867.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 13 lines

drivers/net/phy/dp83867.c static int dp83867_config_init(struct phy_device *phydev) · line 254

Quoted 10 lines
drivers/net/phy/dp83867.c +0 -1
index 2984fd5ae495..5fed837665ea 100644
@@ -251,10 +251,8 @@ static int dp83867_config_init(struct phy_device *phydev)
              ret = phy_write(phydev, MII_DP83867_PHYCTRL, val);
              if (ret)
                      return ret;
-     }
 

Is this hunk ^ intentional?

yes. Might be hard to see idea in patch without looking to the code. But it just removes if bellow and puts the code to upper if stametent. Which is if rgmii().
That is needed for connection type rgmi-txid which has actual setting bellow.

Max.

Quoted 10 lines

drivers/net/phy/dp83867.c static int dp83867_config_init(struct phy_device *phydev) · line 258

Quoted 7 lines
drivers/net/phy/dp83867.c +1 -2
-     if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) &&
-         (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
+             /* Set up RGMII delays */
              val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL);
 
              if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)

--
Florian