Re: svn commit: r185756 - head/sys/dev/re

From: Anton Yuzhaninov <citrin_at_citrin.ru>
Date: Thu, 11 Dec 2008 20:24:09 +0300
Gary Jennejohn wrote:
> On Wed, 10 Dec 2008 21:58:39 +0300
> Anton Yuzhaninov <citrin_at_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)
>>> _at__at_ -417,13 +417,12 _at__at_ 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) {
>>> _at__at_ -445,13 +444,12 _at__at_ 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
Received on Thu Dec 11 2008 - 16:24:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:38 UTC