[SCSI] be2iscsi: Fix Unrecoverable Error Detection
Driver periodically checks adapter state,is up fine or not.
Based on the value updates the internal structures of driver.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index 352fc53..5c87768 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -157,6 +157,9 @@
struct be_cmd_req_hdr *ioctl_hdr;
struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q;
+ if (beiscsi_error(phba))
+ return -EIO;
+
/* wait for the mccq completion */
rc = wait_event_interruptible_timeout(
phba->ctrl.mcc_wait[tag],
@@ -423,7 +426,7 @@
{
int i, status;
for (i = 0; i < mcc_timeout; i++) {
- if (phba->fw_timeout)
+ if (beiscsi_error(phba))
return -EIO;
status = beiscsi_process_mcc(phba);
@@ -439,6 +442,7 @@
BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
"BC_%d : FW Timed Out\n");
phba->fw_timeout = true;
+ beiscsi_ue_detect(phba);
return -EBUSY;
}
return 0;
@@ -479,7 +483,8 @@
u32 ready;
do {
- if (phba->fw_timeout)
+
+ if (beiscsi_error(phba))
return -EIO;
ready = ioread32(db) & MPU_MAILBOX_DB_RDY_MASK;
@@ -491,6 +496,7 @@
BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
"BC_%d : FW Timed Out\n");
phba->fw_timeout = true;
+ beiscsi_ue_detect(phba);
return -EBUSY;
}