From owner-freebsd-amd64@FreeBSD.ORG Mon Nov 1 00:57:38 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6600C16A4CE for ; Mon, 1 Nov 2004 00:57:38 +0000 (GMT) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B1DD43D2D for ; Mon, 1 Nov 2004 00:57:38 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 16836 invoked from network); 1 Nov 2004 00:57:37 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail3.speakeasy.net (qmail-ldap-1.03) with SMTP ; 1 Nov 2004 00:57:37 -0000 Received: from hydrogen.funkthat.com (mdazwt@localhost.funkthat.com [127.0.0.1])iA10vaB6069645; Sun, 31 Oct 2004 16:57:37 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id iA10vZl4069644; Sun, 31 Oct 2004 16:57:35 -0800 (PST) Date: Sun, 31 Oct 2004 16:57:35 -0800 From: John-Mark Gurney To: "Wolfgang S. Rupprecht" Message-ID: <20041101005735.GO22681@funkthat.com> Mail-Followup-To: "Wolfgang S. Rupprecht" , freebsd-amd64@freebsd.org References: <200410312115.i9VLFisD013971@www.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="WR+jf/RUebEcofwt" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: freebsd-amd64@freebsd.org Subject: Re: amd64/73360: sk0: watchdog timeout X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2004 00:57:38 -0000 --WR+jf/RUebEcofwt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Wolfgang S. Rupprecht wrote this message on Sun, Oct 31, 2004 at 14:17 -0800: > > simsong@acm.org (Simson L. Garfinkel) writes: > > sk0: watchdog timeout > > > > I wanted you to know that the problem hasn't gone away. > > Looks like some sk hardware needs to have the tx prodded continually. > > This solved my tx problem under openbsd/amd64 (grabbed from a netbsd > fix). Maybe the freebsd drivers need something similar too? > > --- if_sk.c 14 Oct 2004 15:27:39 -0000 1.47 > +++ if_sk.c 17 Oct 2004 04:30:39 -0000 > @@ -1949,8 +1946,11 @@ sk_txeof(struct sk_if_softc *sc_if) > } > sc_if->sk_cdata.sk_tx_cnt--; > SK_INC(idx, SK_TX_RING_CNT); > - ifp->if_timer = 0; > } > + if (sc_if->sk_cdata.sk_tx_cnt == 0) > + ifp->if_timer = 0; > + else /* nudge chip to keep tx ring moving */ > + CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); > > sc_if->sk_cdata.sk_tx_cons = idx; Hey, thanks for pointing this patch out... I've slightly modified it to better handle IFF_OACTIVE since it's possible to clear the flag when it shouldn't be... If people see this patch improve things, I'll commit it... I haven't tested w/ my sk card yet though... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --WR+jf/RUebEcofwt Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="if_sk.diff" Index: if_sk.c =================================================================== RCS file: /home/ncvs/src/sys/pci/if_sk.c,v retrieving revision 1.86 diff -u -r1.86 if_sk.c --- if_sk.c 20 Aug 2004 06:22:04 -0000 1.86 +++ if_sk.c 1 Nov 2004 00:54:20 -0000 @@ -1816,11 +1816,13 @@ } /* Transmit */ - sc_if->sk_cdata.sk_tx_prod = idx; - CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); + if (idx != sc_if->sk_cdata.sk_tx_prod) { + sc_if->sk_cdata.sk_tx_prod = idx; + CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); - /* Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + /* Set a timeout in case the chip goes out to lunch. */ + ifp->if_timer = 5; + } SK_IF_UNLOCK(sc_if); return; @@ -1960,13 +1962,15 @@ } sc_if->sk_cdata.sk_tx_cnt--; SK_INC(idx, SK_TX_RING_CNT); - ifp->if_timer = 0; } - sc_if->sk_cdata.sk_tx_cons = idx; - - if (cur_tx != NULL) + if (sc_if->sk_cdata.sk_tx_cnt == 0) { + ifp->if_timer = 0; ifp->if_flags &= ~IFF_OACTIVE; + } else /* nudge chip to keep tx ring moving */ + CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); + + sc_if->sk_cdata.sk_tx_cons = idx; return; } --WR+jf/RUebEcofwt--