Subject: Re: New RTL8168 revision(?)
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Dennis den Brok <d.den.brok@uni-bonn.de>
List: tech-kern
Date: 05/10/2007 11:28:46
On Thu, May 10, 2007 at 08:12:15AM +0900, Izumi Tsutsui wrote:
> d.den.brok@uni-bonn.de wrote:
> 
> > Another glitch: I've rather often have to reboot because re(4) says: "re0:  
> > watchdog timeout" to get networking work again. Sometimes it also says  
> > something about reset not having been completed fully. I'd be glad to test  
> > possible fixes or hear about a workaround which doesn't require rebooting,  
> > if anyone can come up with such. This is NetBSD 4.0_BETA2 with re(4) from  
> > -current (because 4.0 doesn't support RTL8168_SPIN3 as of now).
> 
> Could you try this one? (taken from FreeBSD/OpenBSD)
> ---
> Index: rtl8169.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/ic/rtl8169.c,v
> retrieving revision 1.84
> diff -u -r1.84 rtl8169.c
> --- rtl8169.c	21 Mar 2007 12:17:31 -0000	1.84
> +++ rtl8169.c	9 May 2007 12:36:46 -0000
> @@ -1358,9 +1358,21 @@
>  	 * interrupt that will cause us to re-enter this routine.
>  	 * This is done in case the transmitter has gone idle.
>  	 */
> -	if (sc->re_ldata.re_txq_free < RE_TX_QLEN)
> +	if (sc->re_ldata.re_txq_free < RE_TX_QLEN) {
>  		CSR_WRITE_4(sc, RTK_TIMERCNT, 1);
> -	else
> +		if ((sc->sc_quirk & RTKQ_PCIE) != 0) {
> +			/*
> +			 * Some chips will ignore a second TX request
> +			 * issued while an existing transmission is in
> +			 * progress. If the transmitter goes idle but
> +			 * there are still packets waiting to be sent,
> +			 * we need to restart the channel here to flush
> +			 * them out. This only seems to be required with
> +			 * the PCIe devices.
> +			 */
> +			CSR_WRITE_2(sc, RTK_GTXSTART, RTK_TXSTART_START);
> +		}
> +	} else
>  		ifp->if_timer = 0;
>  }
>  
> 
> ---
> Izumi Tsutsui

Sorry, I currently don't have the box in question up. I'll probably be able to test your patch during the next few weeks. Thanks already anyway.

--
Dennis den Brok