Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Sep 2014 00:02:38 +0000 (UTC)
From:      Alexander Kabaev <kan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271561 - head/sys/mips/cavium/octe
Message-ID:  <201409140002.s8E02cUr036043@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kan
Date: Sun Sep 14 00:02:37 2014
New Revision: 271561
URL: http://svnweb.freebsd.org/changeset/base/271561

Log:
  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.

Modified:
  head/sys/mips/cavium/octe/ethernet-mdio.c

Modified: head/sys/mips/cavium/octe/ethernet-mdio.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-mdio.c	Sat Sep 13 23:50:51 2014	(r271560)
+++ head/sys/mips/cavium/octe/ethernet-mdio.c	Sun Sep 14 00:02:37 2014	(r271561)
@@ -71,6 +71,7 @@ int cvm_oct_mdio_read(struct ifnet *ifp,
 	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 *if
 	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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409140002.s8E02cUr036043>