summaryrefslogtreecommitdiffstats
path: root/sys/dev/aha
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-11-09 17:16:39 +0000
committerimp <imp@FreeBSD.org>2003-11-09 17:16:39 +0000
commit9189a12295dbbf9c9e8b80a6095bf5b7c3a24a8b (patch)
tree7cb54da3e3ad972d47d5da8f5c064ca533db442c /sys/dev/aha
parent1480b8c58784db84c665f1ba155e9d414f9457ba (diff)
downloadFreeBSD-src-9189a12295dbbf9c9e8b80a6095bf5b7c3a24a8b.zip
FreeBSD-src-9189a12295dbbf9c9e8b80a6095bf5b7c3a24a8b.tar.gz
Minor tweaks to make it behave better:
o When we're resetting the board, make sure that we error out the pending CCBs first. Otherwise the aha_cmd won't accept further commands, such as those that are used to reset the card (AOP_INITIALIZE_MBOX). This appears to cause a cascade failure where no more commands are possible to the card. o Reduce from 10s down to 1s the amount of time we're willing to tolerate the card being awol. This helps the above case. o Add some error checking to two commands issued in the probe. I have a dim memory of gibbs@ trying to tell me about this problem a few years ago, so pointy hat to imp@ for sitting on it so long.
Diffstat (limited to 'sys/dev/aha')
-rw-r--r--sys/dev/aha/aha.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c
index 82b684b..12c882f 100644
--- a/sys/dev/aha/aha.c
+++ b/sys/dev/aha/aha.c
@@ -410,8 +410,18 @@ aha_fetch_adapter_info(struct aha_softc *aha)
error = aha_cmd(aha, AOP_RETURN_EXT_BIOS_INFO, NULL,
/*paramlen*/0, (u_char *)&extbios, sizeof(extbios),
DEFAULT_CMD_TIMEOUT);
+ if (error != 0) {
+ printf("%s: AOP_RETURN_EXT_BIOS_INFO - Failed.",
+ aha_name(aha));
+ return (error);
+ }
error = aha_cmd(aha, AOP_MBOX_IF_ENABLE, (uint8_t *)&extbios,
/*paramlen*/2, NULL, 0, DEFAULT_CMD_TIMEOUT);
+ if (error != 0) {
+ printf("%s: AOP_MBOX_IF_ENABLE - Failed.",
+ aha_name(aha));
+ return (error);
+ }
}
if (aha->boardid < 0x41)
printf("%s: Warning: aha-1542A won't likely work.\n",
@@ -1477,10 +1487,6 @@ ahareset(struct aha_softc* aha, int hard_reset)
return (ENXIO);
}
- /* If we've allocated mailboxes, initialize them */
- if (aha->init_level > 4)
- ahainitmboxes(aha);
-
/* If we've attached to the XPT, tell it about the event */
if (aha->path != NULL)
xpt_async(AC_BUS_RESET, aha->path, NULL);
@@ -1496,6 +1502,11 @@ ahareset(struct aha_softc* aha, int hard_reset)
ahadone(aha, pending_accb, AMBI_ERROR);
}
+ /* If we've allocated mailboxes, initialize them */
+ /* Must be done after we've aborted our queue, or aha_cmd fails */
+ if (aha->init_level > 4)
+ ahainitmboxes(aha);
+
return (0);
}
@@ -1530,13 +1541,13 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, uint8_t *params,
* while there are pending transactions. Freeze our SIMQ
* and wait for all completions to occur if necessary.
*/
- timeout = 100000;
+ timeout = 10000;
s = splcam();
while (LIST_FIRST(&aha->pending_ccbs) != NULL && --timeout) {
/* Fire the interrupt handler in case interrupts are blocked */
aha_intr(aha);
splx(s);
- DELAY(100);
+ DELAY(10);
s = splcam();
}
splx(s);
@@ -1840,6 +1851,7 @@ ahatimeout(void *arg)
struct aha_softc *aha;
int s;
uint32_t paddr;
+ struct ccb_hdr *ccb_h;
accb = (struct aha_ccb *)arg;
ccb = accb->ccb;
@@ -1868,8 +1880,6 @@ ahatimeout(void *arg)
* be reinstated when the recovery process ends.
*/
if ((accb->flags & ACCB_DEVICE_RESET) == 0) {
- struct ccb_hdr *ccb_h;
-
if ((accb->flags & ACCB_RELEASE_SIMQ) == 0) {
xpt_freeze_simq(aha->sim, /*count*/1);
accb->flags |= ACCB_RELEASE_SIMQ;
OpenPOWER on IntegriCloud