Date: Sun, 31 Oct 2004 16:57:35 -0800 From: John-Mark Gurney <gurney_j@resnet.uoregon.edu> To: "Wolfgang S. Rupprecht" <wolfgang+gnus20041031T133906@dailyplanet.dontspam.wsrcc.com> Cc: freebsd-amd64@freebsd.org Subject: Re: amd64/73360: sk0: watchdog timeout Message-ID: <20041101005735.GO22681@funkthat.com> In-Reply-To: <x7u0sawn1b.fsf@bonnet.wsrcc.com> References: <200410312115.i9VLFisD013971@www.freebsd.org> <x7u0sawn1b.fsf@bonnet.wsrcc.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
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."
[-- Attachment #2 --]
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;
}
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041101005735.GO22681>
