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.
This commit is contained in:
Alexander Kabaev 2014-09-14 00:02:37 +00:00
parent ce20734f95
commit 7cb7fbdee6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271561

View File

@ -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();