From owner-freebsd-current@FreeBSD.ORG Thu Dec 11 11:09:12 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432471065670; Thu, 11 Dec 2008 11:09:12 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout0.freenet.de (mout0.freenet.de [IPv6:2001:748:100:40::2:2]) by mx1.freebsd.org (Postfix) with ESMTP id CDAFB8FC17; Thu, 11 Dec 2008 11:09:11 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.27] (helo=17.mx.freenet.de) by mout0.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #65) id 1LAjPq-000758-Da; Thu, 11 Dec 2008 12:09:10 +0100 Received: from mb4d6.m.pppool.de ([89.49.180.214]:22419 helo=ernst.jennejohn.org) by 17.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #68) id 1LAjPq-0002KU-3y; Thu, 11 Dec 2008 12:09:10 +0100 Date: Thu, 11 Dec 2008 12:09:08 +0100 From: Gary Jennejohn To: Anton Yuzhaninov Message-ID: <20081211120908.57f99124@ernst.jennejohn.org> In-Reply-To: <4940115F.7080004@citrin.ru> References: <200812080248.mB82mfV9043154@svn.freebsd.org> <4940115F.7080004@citrin.ru> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: current@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r185756 - head/sys/dev/re X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 11:09:12 -0000 On Wed, 10 Dec 2008 21:58:39 +0300 Anton Yuzhaninov wrote: > Pyun YongHyeon wrote: > > 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) { > > After this commit I see in logs errors: > > Dec 10 21:37:42 citrin kernel: re0: PHY read failed > Dec 10 21:38:05 citrin last message repeated 3 times > Dec 10 21:38:44 citrin last message repeated 3 times > Dec 10 21:38:44 citrin kernel: re0: link state changed to DOWN > Dec 10 21:38:45 citrin kernel: re0: link state changed to UP > Dec 10 21:38:55 citrin kernel: re0: PHY read failed > Dec 10 21:39:38 citrin last message repeated 3 times > Dec 10 21:39:38 citrin kernel: re0: link state changed to DOWN > Dec 10 21:39:39 citrin kernel: re0: link state changed to UP > Dec 10 21:40:09 citrin kernel: re0: PHY read failed > Dec 10 21:40:21 citrin kernel: re0: PHY read failed > Dec 10 21:41:03 citrin kernel: re0: PHY read failed > > I tried to revert this patch - errors disappeared. > I was seeing these errors too, but disabling MSI made them disappear. --- Gary Jennejohn