From 15c37be0139eb771f8841a7ca61a2569547b1abc Mon Sep 17 00:00:00 2001 From: Scott Long Date: Thu, 16 Sep 2004 02:37:40 +0000 Subject: [PATCH] If the timeout handler runs and notices that commands are timed out, check the firmware status register on the card to see if the firmware is still running. There is no way to recover from this, but at least it can give a hint as whether the car has crashed (which happens all too often). MFC after: 3 days --- sys/dev/aac/aac.c | 10 ++++++++++ sys/dev/aac/aacreg.h | 1 + 2 files changed, 11 insertions(+) diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 44ec3527d59c..0cf61de22d3b 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -1992,11 +1992,13 @@ aac_timeout(struct aac_softc *sc) { struct aac_command *cm; time_t deadline; + int timedout, code; /* * Traverse the busy command list, bitch about late commands once * only. */ + timedout = 0; deadline = time_second - AAC_CMD_TIMEOUT; TAILQ_FOREACH(cm, &sc->aac_busy, cm_link) { if ((cm->cm_timestamp < deadline) @@ -2006,9 +2008,17 @@ aac_timeout(struct aac_softc *sc) "COMMAND %p TIMEOUT AFTER %d SECONDS\n", cm, (int)(time_second-cm->cm_timestamp)); AAC_PRINT_FIB(sc, cm->cm_fib); + timedout++; } } + if (timedout) { + code = AAC_GET_FWSTATUS(sc); + if (code != AAC_UP_AND_RUNNING) { + device_printf(sc->aac_dev, "WARNING! Controller is no " + "longer running! code= 0x%x\n", code); + } + } return; } diff --git a/sys/dev/aac/aacreg.h b/sys/dev/aac/aacreg.h index 426601bac1f8..a1b08b0f4298 100644 --- a/sys/dev/aac/aacreg.h +++ b/sys/dev/aac/aacreg.h @@ -551,6 +551,7 @@ struct aac_adapter_info { * state of the adapter. */ #define AAC_SELF_TEST_FAILED 0x00000004 +#define AAC_MONITOR_PANIC 0x00000020 #define AAC_UP_AND_RUNNING 0x00000080 #define AAC_KERNEL_PANIC 0x00000100