Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Dec 2008 02:48:41 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185756 - head/sys/dev/re
Message-ID:  <200812080248.mB82mfV9043154@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Mon Dec  8 02:48:41 2008
New Revision: 185756
URL: http://svn.freebsd.org/changeset/base/185756

Log:
  Reduce spin wait time consumed in GMII register access routines.
  Waiting for 1ms for each GMII register access looks overkill and it
  may also decrease overall performance of driver because re(4)
  invokes mii_tick for every hz.
  
  Tested by:	rpaulo

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Mon Dec  8 02:38:13 2008	(r185755)
+++ head/sys/dev/re/if_re.c	Mon Dec  8 02:48:41 2008	(r185756)
@@ -417,13 +417,12 @@ re_gmii_readreg(device_t dev, int phy, i
 	}
 
 	CSR_WRITE_4(sc, RL_PHYAR, reg << 16);
-	DELAY(1000);
 
 	for (i = 0; i < RL_TIMEOUT; i++) {
+		DELAY(30);
 		rval = CSR_READ_4(sc, RL_PHYAR);
 		if (rval & RL_PHYAR_BUSY)
 			break;
-		DELAY(100);
 	}
 
 	if (i == RL_TIMEOUT) {
@@ -445,13 +444,12 @@ re_gmii_writereg(device_t dev, int phy, 
 
 	CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) |
 	    (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY);
-	DELAY(1000);
 
 	for (i = 0; i < RL_TIMEOUT; i++) {
+		DELAY(30);
 		rval = CSR_READ_4(sc, RL_PHYAR);
 		if (!(rval & RL_PHYAR_BUSY))
 			break;
-		DELAY(100);
 	}
 
 	if (i == RL_TIMEOUT) {



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