diff options
author | scameron@beardog.cca.cpqcorp.net <scameron@beardog.cca.cpqcorp.net> | 2009-06-08 23:10:57 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-06-09 05:47:44 +0200 |
commit | 3969251b80a7b143d01576780073fe0cc9ef6253 (patch) | |
tree | 7928657a978ccc6eaca6589a5466277dec43409d /drivers/block | |
parent | cciss: Remove no longer needed sendcmd reject processing code (diff) | |
download | linux-3969251b80a7b143d01576780073fe0cc9ef6253.tar.xz linux-3969251b80a7b143d01576780073fe0cc9ef6253.zip |
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>
Diffstat (limited to 'drivers/block')
-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, (void) process_sendcmd_error(h, c); - if (rc == 0 && c->err_info->CommandStatus == CMD_SUCCESS) - break; + if (rc != 0) + goto retry_tur; - if (rc == 0 && - c->err_info->CommandStatus == CMD_TARGET_STATUS && - c->err_info->ScsiStatus == SAM_STAT_CHECK_CONDITION && - (c->err_info->SenseInfo[2] == NO_SENSE || - c->err_info->SenseInfo[2] == UNIT_ATTENTION)) + if (c->err_info->CommandStatus == CMD_SUCCESS) break; + if (c->err_info->CommandStatus == CMD_TARGET_STATUS && + c->err_info->ScsiStatus == SAM_STAT_CHECK_CONDITION) { + if (c->err_info->SenseInfo[2] == NO_SENSE) + break; + if (c->err_info->SenseInfo[2] == UNIT_ATTENTION) { + unsigned char asc; + asc = c->err_info->SenseInfo[12]; + check_for_unit_attention(h, c); + if (asc == POWER_OR_RESET) + break; + } + } +retry_tur: printk(KERN_WARNING "cciss%d: Waiting %d secs " "for device to become ready.\n", h->ctlr, waittime / HZ); |