summaryrefslogtreecommitdiff
path: root/sys/dev/sk
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2006-06-07 09:05:20 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2006-06-07 09:05:20 +0000
commitad25ff2b433846ae8f2c92ca6cbb4ca88c1aea89 (patch)
treec14faa3d7951f6bd37a6f42b32c105fdb4c91de0 /sys/dev/sk
parent3dcdad9a1180121ecdc241ff209f9198727b0256 (diff)
Notes
Diffstat (limited to 'sys/dev/sk')
-rw-r--r--sys/dev/sk/if_sk.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index d15efe89db54..2c3d76da697f 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -2870,10 +2870,17 @@ sk_watchdog(ifp)
sc_if = ifp->if_softc;
SK_IF_LOCK(sc_if);
- if_printf(sc_if->sk_ifp, "watchdog timeout\n");
- ifp->if_oerrors++;
- ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
- sk_init_locked(sc_if);
+ /*
+ * Reclaim first as there is a possibility of loosing Tx completion
+ * interrupt.
+ */
+ sk_txeof(sc_if);
+ if (sc_if->sk_cdata.sk_tx_cnt != 0) {
+ if_printf(sc_if->sk_ifp, "watchdog timeout\n");
+ ifp->if_oerrors++;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ sk_init_locked(sc_if);
+ }
SK_IF_UNLOCK(sc_if);
return;
@@ -3425,8 +3432,7 @@ sk_intr(xsc)
if (sc_if1 != NULL)
ifp1 = sc_if1->sk_ifp;
- status &= sc->sk_intrmask;
- if ((status & sc->sk_intrmask) != 0) {
+ for (; (status &= sc->sk_intrmask) != 0;) {
/* Handle receive interrupts first. */
if (status & SK_ISR_RX1_EOF) {
if (ifp0->if_mtu > SK_MAX_FRAMELEN)
@@ -3480,6 +3486,7 @@ sk_intr(xsc)
sc_if1->sk_phytype == SK_PHYTYPE_BCOM)
sk_intr_bcom(sc_if1);
}
+ status = CSR_READ_4(sc, SK_ISSR);
}
CSR_WRITE_4(sc, SK_IMR, sc->sk_intrmask);