summaryrefslogtreecommitdiffstats
path: root/sys/mips/cavium
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2014-09-14 00:02:37 +0000
committerkan <kan@FreeBSD.org>2014-09-14 00:02:37 +0000
commitfff5c2c5e1d83d5cb78d9e3f743cf2587785ae95 (patch)
treed0575baa0dd69271068c161fc35543c38991bfe9 /sys/mips/cavium
parent5f36980b6578df5b6784664d918bddd2ccdb5331 (diff)
downloadFreeBSD-src-fff5c2c5e1d83d5cb78d9e3f743cf2587785ae95.zip
FreeBSD-src-fff5c2c5e1d83d5cb78d9e3f743cf2587785ae95.tar.gz
Add delay to Octeon MDIO access routines.
Prevent saturattion of the bus by constant polling which in extreme cases can cause interface lockup. This makes FreeBSD match similar case in the executive.
Diffstat (limited to 'sys/mips/cavium')
-rw-r--r--sys/mips/cavium/octe/ethernet-mdio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/mips/cavium/octe/ethernet-mdio.c b/sys/mips/cavium/octe/ethernet-mdio.c
index d95669a..c61a2a6 100644
--- a/sys/mips/cavium/octe/ethernet-mdio.c
+++ b/sys/mips/cavium/octe/ethernet-mdio.c
@@ -71,6 +71,7 @@ int cvm_oct_mdio_read(struct ifnet *ifp, int phy_id, int location)
cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64);
do {
+ cvmx_wait(1000);
smi_rd.u64 = cvmx_read_csr(CVMX_SMI_RD_DAT);
} while (smi_rd.s.pending);
@@ -108,6 +109,7 @@ void cvm_oct_mdio_write(struct ifnet *ifp, int phy_id, int location, int val)
cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64);
do {
+ cvmx_wait(1000);
smi_wr.u64 = cvmx_read_csr(CVMX_SMI_WR_DAT);
} while (smi_wr.s.pending);
MDIO_UNLOCK();
OpenPOWER on IntegriCloud