Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Aug 2002 18:48:48 +0300
From:      Alexandr Kovalenko <never@nevermind.kiev.ua>
To:        Jesper Skriver <jesper@FreeBSD.ORG>
Cc:        Mike Silbersack <silby@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, re@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/pci if_vr.c
Message-ID:  <20020807154848.GA49226@nevermind.kiev.ua>
In-Reply-To: <20020807141259.GC47372@nevermind.kiev.ua>
References:  <200205200118.g4K1I6L62015@freefall.freebsd.org> <20020807120243.GA45698@nevermind.kiev.ua> <20020807140430.GB29228@FreeBSD.org> <20020807141259.GC47372@nevermind.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline

On Wed, Aug 07, 2002 at 05:12:59PM +0300, I wrote:

> > > > silby       2002/05/19 18:18:06 PDT
> > > >   Modified files:        (Branch: RELENG_4)
> > > >     sys/pci              if_vr.c 
> > > >   Log:
> > > >   MFC rev 1.49
> > > >   
> > > >           Recover more gracefully under certain conditions... see
> > > >           log for rev 1.49 for full description.
> > > Anyway, I'm still have lockups here when driver cannot reset card.
> > > I'll try to reproduce error again.
> > > 4.6.1-RELEASE-p10
> > That version does not have the above change, it's from the RELENG_4_6
> > branch, you need to track RELENG_4 to get the above change.
> Oh, yeah, sure.
> 
> But I cannot track -STABLE for stability reasons anyway.
> I suppose re@ will agree that this fix should be merged into RELENG_4_6
> before 4.6.2, because vr(4) is standard network adapter for VIA Eden
> low-cost popular platform...
> 
> P.S. I'm trying now patch, which silby@ sent to me. Will report results.
Patch, sent to me by silby@ works great, no device timeouts/aything
else. Device don't locks up. Please, merge into RELENG_4_6 before
4.6.2.

-- 
NEVE-RIPE
Ukrainian FreeBSD User Group
http://uafug.org.ua/

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=koi8-r
Content-Disposition: attachment; filename="nystrom2-vr.patch"

diff -u -r /usr/src/sys.old/pci/if_vr.c pci/if_vr.c
--- /usr/src/sys.old/pci/if_vr.c	Tue Jul 30 15:08:18 2002
+++ pci/if_vr.c	Mon Aug  5 10:56:52 2002
@@ -1090,6 +1090,15 @@
 		cur_tx = sc->vr_cdata.vr_tx_head;
 		txstat = cur_tx->vr_ptr->vr_status;
 
+		if ((txstat & VR_TXSTAT_ABRT) ||
+		    (txstat & VR_TXSTAT_UDF)) {
+			while (CSR_READ_2(sc, VR_COMMAND) & VR_CMD_TX_ON)
+				;	/* Wait for chip to shutdown */
+			VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
+			CSR_WRITE_4(sc, VR_TXADDR, vtophys(cur_tx->vr_ptr));
+			break;
+		}
+
 		if (txstat & VR_TXSTAT_OWN)
 			break;
 
@@ -1198,24 +1207,27 @@
 			vr_rxeoc(sc);
 		}
 
-		if (status & VR_ISR_TX_OK) {
-			vr_txeof(sc);
-			vr_txeoc(sc);
+		if ((status & VR_ISR_BUSERR) || (status & VR_ISR_TX_UNDERRUN)) {
+			vr_reset(sc);
+			vr_init(sc);
+			break;
 		}
 
-		if ((status & VR_ISR_TX_UNDERRUN)||(status & VR_ISR_TX_ABRT)){ 
-			ifp->if_oerrors++;
+		if ((status & VR_ISR_TX_OK) || (status & VR_ISR_TX_ABRT) ||
+		    (status & VR_ISR_TX_ABRT2) || (status & VR_ISR_UDFI)) {
 			vr_txeof(sc);
-			if (sc->vr_cdata.vr_tx_head != NULL) {
-				VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON);
-				VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_GO);
-			}
+			if ((status & VR_ISR_UDFI) ||
+			    (status & VR_ISR_TX_ABRT2) ||
+			    (status & VR_ISR_TX_ABRT)) {
+				ifp->if_oerrors++;
+				if (sc->vr_cdata.vr_tx_head != NULL) {
+					VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON);
+					VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_GO);
+				}
+			} else
+				vr_txeoc(sc);
 		}
 
-		if (status & VR_ISR_BUSERR) {
-			vr_reset(sc);
-			vr_init(sc);
-		}
 	}
 
 	/* Re-enable interrupts. */
diff -u -r /usr/src/sys.old/pci/if_vrreg.h pci/if_vrreg.h
--- /usr/src/sys.old/pci/if_vrreg.h	Tue Jul 30 15:08:18 2002
+++ pci/if_vrreg.h	Mon Aug  5 10:57:03 2002
@@ -149,6 +149,8 @@
 #define VR_ISR_STATSOFLOW	0x0080	/* stats counter oflow */
 #define VR_ISR_RX_EARLY		0x0100	/* rx early */
 #define VR_ISR_LINKSTAT		0x0200	/* MII status change */
+#define VR_ISR_ETI		0x0200	/* Tx early (3043/3071) */
+#define VR_ISR_UDFI		0x0200	/* Tx FIFO underflow (3065) */
 #define VR_ISR_RX_OFLOW		0x0400	/* rx FIFO overflow */
 #define VR_ISR_RX_DROPPED	0x0800
 #define VR_ISR_RX_NOBUF2	0x1000
@@ -328,6 +330,7 @@
 #define VR_TXSTAT_ABRT		0x00000100
 #define VR_TXSTAT_LATECOLL	0x00000200
 #define VR_TXSTAT_CARRLOST	0x00000400
+#define VR_TXSTAT_UDF		0x00000800
 #define VR_TXSTAT_BUSERR	0x00002000
 #define VR_TXSTAT_JABTIMEO	0x00004000
 #define VR_TXSTAT_ERRSUM	0x00008000

--qDbXVdCdHGoSgWSk--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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