aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/siis
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2011-04-19 08:01:17 +0000
committerAlexander Motin <mav@FreeBSD.org>2011-04-19 08:01:17 +0000
commit6ac0befde2c5873a3cdae7fcec45facd817ae151 (patch)
treeb127f1c0f2074a00cefb5b52a4696a36352ccb98 /sys/dev/siis
parentc819dfaeba2efc22541960dcf8aed0ce9e8bf19d (diff)
Notes
Diffstat (limited to 'sys/dev/siis')
-rw-r--r--sys/dev/siis/siis.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c
index b974cf2eae2e..6e77e2ecb54f 100644
--- a/sys/dev/siis/siis.c
+++ b/sys/dev/siis/siis.c
@@ -1373,11 +1373,22 @@ siis_issue_recovery(device_t dev)
}
if (i == SIIS_MAX_SLOTS)
return;
- ch->recoverycmd = 1;
ccb = xpt_alloc_ccb_nowait();
if (ccb == NULL) {
- device_printf(dev, "Unable allocate READ LOG command");
- return; /* XXX */
+ device_printf(dev, "Unable allocate recovery command\n");
+completeall:
+ /* We can't do anything -- complete holden commands. */
+ for (i = 0; i < SIIS_MAX_SLOTS; i++) {
+ if (ch->hold[i] == NULL)
+ continue;
+ ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
+ ch->hold[i]->ccb_h.status |= CAM_RESRC_UNAVAIL;
+ xpt_done(ch->hold[i]);
+ ch->hold[i] = NULL;
+ ch->numhslots--;
+ }
+ siis_reset(dev);
+ return;
}
ccb->ccb_h = ch->hold[i]->ccb_h; /* Reuse old header. */
if (ccb->ccb_h.func_code == XPT_ATA_IO) {
@@ -1390,8 +1401,9 @@ siis_issue_recovery(device_t dev)
ataio->data_ptr = malloc(512, M_SIIS, M_NOWAIT);
if (ataio->data_ptr == NULL) {
xpt_free_ccb(ccb);
- device_printf(dev, "Unable allocate memory for READ LOG command");
- return; /* XXX */
+ device_printf(dev,
+ "Unable allocate memory for READ LOG command\n");
+ goto completeall;
}
ataio->dxfer_len = 512;
bzero(&ataio->cmd, sizeof(ataio->cmd));
@@ -1418,6 +1430,7 @@ siis_issue_recovery(device_t dev)
csio->cdb_io.cdb_bytes[0] = 0x03;
csio->cdb_io.cdb_bytes[4] = csio->dxfer_len;
}
+ ch->recoverycmd = 1;
siis_begin_transaction(dev, ccb);
}