aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mdio.c')
-rw-r--r--drivers/net/mdio.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/mdio.c b/drivers/net/mdio.c
index 6851bdb2ce29..7d2e610f14ff 100644
--- a/drivers/net/mdio.c
+++ b/drivers/net/mdio.c
@@ -109,13 +109,20 @@ int mdio45_links_ok(const struct mdio_if_info *mdio, u32 mmd_mask)
109 if (mmd_mask & (1 << devad)) { 109 if (mmd_mask & (1 << devad)) {
110 mmd_mask &= ~(1 << devad); 110 mmd_mask &= ~(1 << devad);
111 111
112 /* Read twice because link state is latched and a 112 /* Reset the latched status and fault flags */
113 * read moves the current state into the register */
114 mdio->mdio_read(mdio->dev, mdio->prtad, 113 mdio->mdio_read(mdio->dev, mdio->prtad,
115 devad, MDIO_STAT1); 114 devad, MDIO_STAT1);
115 if (devad == MDIO_MMD_PMAPMD || devad == MDIO_MMD_PCS ||
116 devad == MDIO_MMD_PHYXS || devad == MDIO_MMD_DTEXS)
117 mdio->mdio_read(mdio->dev, mdio->prtad,
118 devad, MDIO_STAT2);
119
120 /* Check the current status and fault flags */
116 reg = mdio->mdio_read(mdio->dev, mdio->prtad, 121 reg = mdio->mdio_read(mdio->dev, mdio->prtad,
117 devad, MDIO_STAT1); 122 devad, MDIO_STAT1);
118 if (reg < 0 || !(reg & MDIO_STAT1_LSTATUS)) 123 if (reg < 0 ||
124 (reg & (MDIO_STAT1_FAULT | MDIO_STAT1_LSTATUS)) !=
125 MDIO_STAT1_LSTATUS)
119 return false; 126 return false;
120 } 127 }
121 } 128 }