summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/tenxpress.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-12-26 13:46:12 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-26 13:46:12 -0800
commitcaa8d8bbddc9157cb8f34465be98fc83faf37155 (patch)
tree614d9c3396b94f154239a8199758b4068c72a3e5 /drivers/net/sfc/tenxpress.c
parent6977dc6309ea8bbcb24c0a1356c33969e4a07410 (diff)
sfc: Fix unreliable link detection in some loopback modes
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/tenxpress.c')
-rw-r--r--drivers/net/sfc/tenxpress.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c
index b3ca2dc8040..1567ab538e2 100644
--- a/drivers/net/sfc/tenxpress.c
+++ b/drivers/net/sfc/tenxpress.c
@@ -445,14 +445,13 @@ static bool sft9001_link_ok(struct efx_nic *efx, struct ethtool_cmd *ecmd)
int phy_id = efx->mii.phy_id;
u32 reg;
- if (efx->loopback_mode == LOOPBACK_GPHY)
- return true;
- else if (efx_phy_mode_disabled(efx->phy_mode))
+ if (efx_phy_mode_disabled(efx->phy_mode))
return false;
+ else if (efx->loopback_mode == LOOPBACK_GPHY)
+ return true;
else if (efx->loopback_mode)
return mdio_clause45_links_ok(efx,
MDIO_MMDREG_DEVS_PMAPMD |
- MDIO_MMDREG_DEVS_PCS |
MDIO_MMDREG_DEVS_PHYXS);
/* We must use the same definition of link state as LASI,
@@ -588,6 +587,10 @@ static void tenxpress_phy_poll(struct efx_nic *efx)
change = true;
}
sfx7101_check_bad_lp(efx, link_ok);
+ } else if (efx->loopback_mode) {
+ bool link_ok = sft9001_link_ok(efx, NULL);
+ if (link_ok != efx->link_up)
+ change = true;
} else {
u32 status = mdio_clause45_read(efx, efx->mii.phy_id,
MDIO_MMD_PMAPMD,