From: Tomas Henzl <thenzl@redhat.com> Date: Sun, 29 Aug 2010 15:49:11 -0400 Subject: [block] cciss: change SCSI error handling code Message-id: <1283097002-3341-13-git-send-email-thenzl@redhat.com> Patchwork-id: 27865 O-Subject: [RHEL6 PATCH 12/63] cciss: change SCSI error handling code Bugzilla: 568830 RH-Acked-by: Neil Horman <nhorman@redhat.com> In the SCSI error handling code, decode UNIT ATTENTION ASC, ASCQ via calling check_for_unit_attention. diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index cee6baa..ae4169a 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -1480,16 +1480,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);