Skip to content

Commit 5a7f08c

Browse files
grygoriySdavem330
authored andcommitted
net: phy: dp83867: enable robust auto-mdix
The link detection timeouts can be observed (or link might not be detected at all) when dp83867 PHY is configured in manual mode (speed/duplex). CFG3[9] Robust Auto-MDIX option allows to 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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 546b85b commit 5a7f08c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/net/phy/dp83867.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@
9595
#define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK (0x1f << 8)
9696
#define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT 8
9797

98+
/* CFG3 bits */
99+
#define DP83867_CFG3_INT_OE BIT(7)
100+
#define DP83867_CFG3_ROBUST_AUTO_MDIX BIT(9)
101+
98102
/* CFG4 bits */
99103
#define DP83867_CFG4_PORT_MIRROR_EN BIT(0)
100104

@@ -410,12 +414,13 @@ static int dp83867_config_init(struct phy_device *phydev)
410414
phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL, val);
411415
}
412416

417+
val = phy_read(phydev, DP83867_CFG3);
413418
/* Enable Interrupt output INT_OE in CFG3 register */
414-
if (phy_interrupt_is_valid(phydev)) {
415-
val = phy_read(phydev, DP83867_CFG3);
416-
val |= BIT(7);
417-
phy_write(phydev, DP83867_CFG3, val);
418-
}
419+
if (phy_interrupt_is_valid(phydev))
420+
val |= DP83867_CFG3_INT_OE;
421+
422+
val |= DP83867_CFG3_ROBUST_AUTO_MDIX;
423+
phy_write(phydev, DP83867_CFG3, val);
419424

420425
if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP)
421426
dp83867_config_port_mirroring(phydev);

0 commit comments

Comments
 (0)