diff mbox series

[1/2] net: phy: dp83867: enable robust auto-mdix

Message ID 20191023144846.1381-2-grygorii.strashko@ti.com
State Accepted
Commit 5a7f08c2abb0efc9d17aff2fc75d6d3b85e622e4
Headers show
Series net: phy: dp83867: enable robust auto-mdix | expand

Commit Message

Grygorii Strashko Oct. 23, 2019, 2:48 p.m. UTC
The link detection timeouts can be observed (or link might not be detected
at all) when dp83867 PHY is configured in manual mode (speed/duplexity).

CFG3[9] Robust Auto-MDIX option allows significantly improve link detection
in case dp83867 is configured in manual mode and reduce link detection
time.
As per DM: "If link partners are configured to operational modes that are
not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force
100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto
MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock."

Hence, enable this option by default as there are no known reasons
not to do so.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

---
 drivers/net/phy/dp83867.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

-- 
2.17.1

Comments

Andrew Lunn Oct. 23, 2019, 3:38 p.m. UTC | #1
On Wed, Oct 23, 2019 at 05:48:45PM +0300, Grygorii Strashko wrote:
> The link detection timeouts can be observed (or link might not be detected

> at all) when dp83867 PHY is configured in manual mode (speed/duplexity).

> 

> CFG3[9] Robust Auto-MDIX option allows significantly improve link detection

> in case dp83867 is configured in manual mode and reduce link detection

> time.

> As per DM: "If link partners are configured to operational modes that are

> not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force

> 100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto

> MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock."

> 

> Hence, enable this option by default as there are no known reasons

> not to do so.

> 

> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>


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


    Andrew
Florian Fainelli Oct. 24, 2019, 2:38 a.m. UTC | #2
On 10/23/2019 7:48 AM, Grygorii Strashko wrote:
> The link detection timeouts can be observed (or link might not be detected

> at all) when dp83867 PHY is configured in manual mode (speed/duplexity).


s/duplexity/duplex/

> 

> CFG3[9] Robust Auto-MDIX option allows significantly improve link detection


allows to

> in case dp83867 is configured in manual mode and reduce link detection

> time.

> As per DM: "If link partners are configured to operational modes that are

> not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force

> 100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto

> MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock."

> 

> Hence, enable this option by default as there are no known reasons

> not to do so.

> 

> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>


Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

-- 
Florian
diff mbox series

Patch

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 37fceaf9fa10..cf4455bbf888 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -95,6 +95,10 @@ 
 #define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK	(0x1f << 8)
 #define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT	8
 
+/* CFG3 bits */
+#define DP83867_CFG3_INT_OE			BIT(7)
+#define DP83867_CFG3_ROBUST_AUTO_MDIX		BIT(9)
+
 /* CFG4 bits */
 #define DP83867_CFG4_PORT_MIRROR_EN              BIT(0)
 
@@ -410,12 +414,13 @@  static int dp83867_config_init(struct phy_device *phydev)
 		phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL, val);
 	}
 
+	val = phy_read(phydev, DP83867_CFG3);
 	/* Enable Interrupt output INT_OE in CFG3 register */
-	if (phy_interrupt_is_valid(phydev)) {
-		val = phy_read(phydev, DP83867_CFG3);
-		val |= BIT(7);
-		phy_write(phydev, DP83867_CFG3, val);
-	}
+	if (phy_interrupt_is_valid(phydev))
+		val |= DP83867_CFG3_INT_OE;
+
+	val |= DP83867_CFG3_ROBUST_AUTO_MDIX;
+	phy_write(phydev, DP83867_CFG3, val);
 
 	if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP)
 		dp83867_config_port_mirroring(phydev);