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
This commit is contained in:
Scott Long 2004-09-16 02:37:40 +00:00
parent ee9e2737a1
commit 15c37be013
2 changed files with 11 additions and 0 deletions

View File

@ -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;
}

View File

@ -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