Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Dec 2008 20:24:09 +0300
From:      Anton Yuzhaninov <citrin@citrin.ru>
To:        gary.jennejohn@freenet.de
Cc:        current@freebsd.org, Pyun YongHyeon <yongari@FreeBSD.org>
Subject:   Re: svn commit: r185756 - head/sys/dev/re
Message-ID:  <49414CB9.7060903@citrin.ru>
In-Reply-To: <20081211120908.57f99124@ernst.jennejohn.org>
References:  <200812080248.mB82mfV9043154@svn.freebsd.org>	<4940115F.7080004@citrin.ru> <20081211120908.57f99124@ernst.jennejohn.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Gary Jennejohn wrote:
> On Wed, 10 Dec 2008 21:58:39 +0300
> Anton Yuzhaninov <citrin@citrin.ru> 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.

1. MSI don't used (seems to be not supported by this NIC or blacklisted).

2. Commit

http://svn.freebsd.org/changeset/base/185896

fixes this errors.

-- 
  Anton Yuzhaninov



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