Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Don't treat the "reset complete" interrupts as e...



details:   https://anonhg.NetBSD.org/src/rev/fda030523860
branches:  trunk
changeset: 535124:fda030523860
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Aug 10 22:54:54 2002 +0000

description:
Don't treat the "reset complete" interrupts as errors.  Doing so
causes us to go into a reset/interrupt/reset/... loop.

diffstat:

 sys/dev/pci/if_sip.c |  29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diffs (70 lines):

diff -r 76e6e32839de -r fda030523860 sys/dev/pci/if_sip.c
--- a/sys/dev/pci/if_sip.c      Sat Aug 10 21:49:14 2002 +0000
+++ b/sys/dev/pci/if_sip.c      Sat Aug 10 22:54:54 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sip.c,v 1.61 2002/07/11 18:07:56 thorpej Exp $      */
+/*     $NetBSD: if_sip.c,v 1.62 2002/08/10 22:54:54 thorpej Exp $      */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.61 2002/07/11 18:07:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.62 2002/08/10 22:54:54 thorpej Exp $");
 
 #include "bpfilter.h"
 
@@ -258,6 +258,7 @@
        struct evcnt sc_ev_txdintr;     /* Tx descriptor interrupts */
        struct evcnt sc_ev_txiintr;     /* Tx idle interrupts */
        struct evcnt sc_ev_rxintr;      /* Rx interrupts */
+       struct evcnt sc_ev_hiberr;      /* HIBERR interrupts */
 #ifdef DP83820
        struct evcnt sc_ev_rxipsum;     /* IP checksums checked in-bound */
        struct evcnt sc_ev_rxtcpsum;    /* TCP checksums checked in-bound */
@@ -1029,6 +1030,8 @@
            NULL, sc->sc_dev.dv_xname, "txiintr");
        evcnt_attach_dynamic(&sc->sc_ev_rxintr, EVCNT_TYPE_INTR,
            NULL, sc->sc_dev.dv_xname, "rxintr");
+       evcnt_attach_dynamic(&sc->sc_ev_hiberr, EVCNT_TYPE_INTR,
+           NULL, sc->sc_dev.dv_xname, "hiberr");
 #ifdef DP83820
        evcnt_attach_dynamic(&sc->sc_ev_rxipsum, EVCNT_TYPE_MISC,
            NULL, sc->sc_dev.dv_xname, "rxipsum");
@@ -1573,15 +1576,31 @@
 #endif /* ! DP83820 */
 
                if (isr & ISR_HIBERR) {
+                       int want_init = 0;
+
+                       SIP_EVCNT_INCR(&sc->sc_ev_hiberr);
+
 #define        PRINTERR(bit, str)                                              \
-                       if (isr & (bit))                                \
-                               printf("%s: %s\n", sc->sc_dev.dv_xname, str)
+                       do {                                            \
+                               if (isr & (bit)) {                      \
+                                       printf("%s: %s\n",              \
+                                           sc->sc_dev.dv_xname, str);  \
+                                       want_init = 1;                  \
+                               }                                       \
+                       } while (/*CONSTCOND*/0)
+
                        PRINTERR(ISR_DPERR, "parity error");
                        PRINTERR(ISR_SSERR, "system error");
                        PRINTERR(ISR_RMABT, "master abort");
                        PRINTERR(ISR_RTABT, "target abort");
                        PRINTERR(ISR_RXSOVR, "receive status FIFO overrun");
-                       (void) SIP_DECL(init)(ifp);
+                       /*
+                        * Ignore:
+                        *      Tx reset complete
+                        *      Rx reset complete
+                        */
+                       if (want_init)
+                               (void) SIP_DECL(init)(ifp);
 #undef PRINTERR
                }
        }



Home | Main Index | Thread Index | Old Index