PERFORCE change 93475 for review

Warner Losh imp at FreeBSD.org
Fri Mar 17 22:18:52 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=93475

Change 93475 by imp at imp_Speedy on 2006/03/17 22:18:19

	in ate_start don't be a dumbass:
	
	(1) Don't set sc->sent_mbuf[1] = m.  This will lead to multiple
	frees of the same mbuf and the panic follows.
	(2) Loop while we have buffer space to loop.  not 100% sure this
	is right.
	
	Remove debug printf.  They are now in the way.
	
	This commit brought to you by:
	Trying to mount root from nfs:
	NFS ROOT: 206.168.13.207:/arm-nfsroot
	warning: no time-of-day clock registered, system time will not be set accurately
	warning: no time-of-day clock registered, system time will not be set accurately
	Enter full pathname of shell or RETURN for /bin/sh: 
	# ls /
	.snap   boot    etc     libexec proc    root    sys     usr
	bin     dev     lib     mnt     rescue  sbin    tmp     var
	# 

Affected files ...

.. //depot/projects/arm/src/sys/arm/at91/if_ate.c#42 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/at91/if_ate.c#42 (text+ko) ====

@@ -586,8 +586,6 @@
 	status = RD4(sc, ETH_ISR);
 	if (status == 0)
 		return;
-//	printf("status is %x IT IS %x %x\n", status, RD4(sc, ETH_RSR), RD4(sc, ETH_CTL));
-
 	if (status & ETH_ISR_RCOM) {
 		bus_dmamap_sync(sc->rx_desc_tag, sc->rx_desc_map,
 		    BUS_DMASYNC_POSTREAD);
@@ -619,7 +617,6 @@
 			/* Flush memory for mbuf so we don't get stale bytes */
 			bus_dmamap_sync(sc->rxtag, sc->rx_map[i],
 			    BUS_DMASYNC_POSTREAD);
-			printf("GOT ONE %d %x %d\n", i, rx_stat, rx_stat & ETH_LEN_MASK);
 			WR4(sc, ETH_RSR, RD4(sc, ETH_RSR));
 			/*
 			 * Allocate a new buffer to replace this one.
@@ -682,8 +679,10 @@
 	}
 	if (status & ETH_ISR_TCOM) {
 		ATE_LOCK(sc);
-		if (sc->sent_mbuf[0])
+		if (sc->sent_mbuf[0]) {
 			m_freem(sc->sent_mbuf[0]);
+			sc->sent_mbuf[0] = NULL;
+		}
 		if (sc->sent_mbuf[1]) {
 			if (RD4(sc, ETH_TSR) & ETH_TSR_IDLE) {
 				m_freem(sc->sent_mbuf[1]);
@@ -707,6 +706,7 @@
 		ATE_UNLOCK(sc);
 	}
 	if (status & ETH_ISR_RBNA) {
+		printf("RBNA workaround\n");
 		/* Workaround Errata #11 */
 		WR4(sc, ETH_CTL, RD4(sc, ETH_CTL) &~ ETH_CTL_RE);
 		WR4(sc, ETH_CTL, RD4(sc, ETH_CTL) | ETH_CTL_RE);
@@ -835,11 +835,7 @@
 	 */
 	BPF_MTAP(ifp, m);
 
-	/*
-	 * Once we've queued one packet, we'll do the rest via the ISR,
-	 * save off a pointer.
-	 */
-	sc->sent_mbuf[1] = m;
+	goto outloop;
 }
 
 static void


More information about the p4-projects mailing list