From owner-p4-projects@FreeBSD.ORG Fri Mar 17 22:18:52 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5575A16A424; Fri, 17 Mar 2006 22:18:52 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3595116A422 for ; Fri, 17 Mar 2006 22:18:52 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D84F243D45 for ; Fri, 17 Mar 2006 22:18:51 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2HMIplf017701 for ; Fri, 17 Mar 2006 22:18:51 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2HMIpiV017698 for perforce@freebsd.org; Fri, 17 Mar 2006 22:18:51 GMT (envelope-from imp@freebsd.org) Date: Fri, 17 Mar 2006 22:18:51 GMT Message-Id: <200603172218.k2HMIpiV017698@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 93475 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Mar 2006 22:18:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=93475 Change 93475 by imp@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