summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2010-05-31 19:35:04 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2010-05-31 19:35:04 +0000
commitc72aa480d21cfe8c7de6772a263b0baa5119e814 (patch)
treee45ba7d947cfa2534955196d18fdc2d303345b8f
parent31165e78f65d7469a8ab0623752b6dd84afd65a4 (diff)
do not immediately panic if we find a non-increasing heartbeat counter but
keep count for at least 33 seconds. then panic. ok marco@, moral support johan@
-rw-r--r--sys/dev/ic/ciss.c21
-rw-r--r--sys/dev/ic/cissvar.h3
2 files changed, 19 insertions, 5 deletions
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c
index c762165b495..99dd4e5eb22 100644
--- a/sys/dev/ic/ciss.c
+++ b/sys/dev/ic/ciss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciss.c,v 1.42 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: ciss.c,v 1.43 2010/05/31 19:35:03 halex Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -1034,10 +1034,23 @@ ciss_heartbeat(void *v)
hb = bus_space_read_4(sc->iot, sc->cfg_ioh,
sc->cfgoff + offsetof(struct ciss_config, heartbeat));
- if (hb == sc->heartbeat)
- panic("%s: dead", sc->sc_dev.dv_xname); /* XXX reset! */
- else
+ if (hb == sc->heartbeat) {
+ sc->fibrillation++;
+ CISS_DPRINTF(CISS_D_ERR, ("%s: fibrillation #%d (value=%d)\n",
+ sc->sc_dev.dv_xname, sc->fibrillation, hb));
+ if (sc->fibrillation >= 11) {
+ /* No heartbeat for 33 seconds */
+ panic("%s: dead", sc->sc_dev.dv_xname); /* XXX reset! */
+ }
+ } else {
sc->heartbeat = hb;
+ if (sc->fibrillation) {
+ CISS_DPRINTF(CISS_D_ERR, ("%s: "
+ "fibrillation ended (value=%d)\n",
+ sc->sc_dev.dv_xname, hb));
+ }
+ sc->fibrillation = 0;
+ }
timeout_add_sec(&sc->sc_hb, 3);
}
diff --git a/sys/dev/ic/cissvar.h b/sys/dev/ic/cissvar.h
index 2187c9afad0..5dc7a415806 100644
--- a/sys/dev/ic/cissvar.h
+++ b/sys/dev/ic/cissvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cissvar.h,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: cissvar.h,v 1.8 2010/05/31 19:35:03 halex Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -55,6 +55,7 @@ struct ciss_softc {
int cfgoff;
u_int32_t iem;
u_int32_t heartbeat;
+ int fibrillation;
struct ciss_ld **sc_lds;
};