diff options
author | scameron@beardog.cca.cpqcorp.net <scameron@beardog.cca.cpqcorp.net> | 2009-06-08 17:10:57 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-06-08 23:47:44 -0400 |
commit | 3969251b80a7b143d01576780073fe0cc9ef6253 (patch) | |
tree | 7928657a978ccc6eaca6589a5466277dec43409d | |
parent | 72f9f1324fc4cd450c92e4600a710231b0445c75 (diff) |
cciss: decode unit attention in SCSI error handling code
Make SCSI reset error handler decode unit attention ASC
and after a target reset wait for a unit attention that indicates
a reset occurred rather than just for any old unit attention.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | drivers/block/cciss_scsi.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index d2eb48977410..3315268b4ec7 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -1604,16 +1604,25 @@ static int wait_for_device_to_become_ready(ctlr_info_t *h, | |||
1604 | 1604 | ||
1605 | (void) process_sendcmd_error(h, c); | 1605 | (void) process_sendcmd_error(h, c); |
1606 | 1606 | ||
1607 | if (rc == 0 && c->err_info->CommandStatus == CMD_SUCCESS) | 1607 | if (rc != 0) |
1608 | break; | 1608 | goto retry_tur; |
1609 | 1609 | ||
1610 | if (rc == 0 && | 1610 | if (c->err_info->CommandStatus == CMD_SUCCESS) |
1611 | c->err_info->CommandStatus == CMD_TARGET_STATUS && | ||
1612 | c->err_info->ScsiStatus == SAM_STAT_CHECK_CONDITION && | ||
1613 | (c->err_info->SenseInfo[2] == NO_SENSE || | ||
1614 | c->err_info->SenseInfo[2] == UNIT_ATTENTION)) | ||
1615 | break; | 1611 | break; |
1616 | 1612 | ||
1613 | if (c->err_info->CommandStatus == CMD_TARGET_STATUS && | ||
1614 | c->err_info->ScsiStatus == SAM_STAT_CHECK_CONDITION) { | ||
1615 | if (c->err_info->SenseInfo[2] == NO_SENSE) | ||
1616 | break; | ||
1617 | if (c->err_info->SenseInfo[2] == UNIT_ATTENTION) { | ||
1618 | unsigned char asc; | ||
1619 | asc = c->err_info->SenseInfo[12]; | ||
1620 | check_for_unit_attention(h, c); | ||
1621 | if (asc == POWER_OR_RESET) | ||
1622 | break; | ||
1623 | } | ||
1624 | } | ||
1625 | retry_tur: | ||
1617 | printk(KERN_WARNING "cciss%d: Waiting %d secs " | 1626 | printk(KERN_WARNING "cciss%d: Waiting %d secs " |
1618 | "for device to become ready.\n", | 1627 | "for device to become ready.\n", |
1619 | h->ctlr, waittime / HZ); | 1628 | h->ctlr, waittime / HZ); |