Skip to content

Commit ef63461

Browse files
Russell King (Oracle)davem330
authored andcommitted
net: pcs: xpcs: remove double-read of link state when using AN
Phylink does not want the current state of the link when reading the PCS link state - it wants the latched state. Don't double-read the MII status register. Phylink will re-read as necessary to capture transient link-down events as of dbae338 ("net: phylink: Force retrigger in case of latched link-fail indicator"). The above referenced commit is a dependency for this change, and thus this change should not be backported to any kernel that does not contain the above referenced commit. Fixes: fcb26bd ("net: phy: Add Synopsys DesignWare XPCS MDIO module") Signed-off-by: Russell King (Oracle) <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent abf3670 commit ef63461

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/net/pcs/pcs-xpcs.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static int xpcs_read_fault_c73(struct dw_xpcs *xpcs,
321321
return 0;
322322
}
323323

324-
static int xpcs_read_link_c73(struct dw_xpcs *xpcs, bool an)
324+
static int xpcs_read_link_c73(struct dw_xpcs *xpcs)
325325
{
326326
bool link = true;
327327
int ret;
@@ -333,15 +333,6 @@ static int xpcs_read_link_c73(struct dw_xpcs *xpcs, bool an)
333333
if (!(ret & MDIO_STAT1_LSTATUS))
334334
link = false;
335335

336-
if (an) {
337-
ret = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_STAT1);
338-
if (ret < 0)
339-
return ret;
340-
341-
if (!(ret & MDIO_STAT1_LSTATUS))
342-
link = false;
343-
}
344-
345336
return link;
346337
}
347338

@@ -935,7 +926,7 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs,
935926
int ret;
936927

937928
/* Link needs to be read first ... */
938-
state->link = xpcs_read_link_c73(xpcs, state->an_enabled) > 0 ? 1 : 0;
929+
state->link = xpcs_read_link_c73(xpcs) > 0 ? 1 : 0;
939930

940931
/* ... and then we check the faults. */
941932
ret = xpcs_read_fault_c73(xpcs, state);

0 commit comments

Comments
 (0)