diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2006-12-13 22:20:30 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-01-03 17:58:01 -0500 |
commit | 0c8c39af1699227e5a5d13e54a71f93347fe4f61 (patch) | |
tree | 2abc0991a6cbb8d45e7164a8a05deb25d5004db7 /drivers/scsi/qla2xxx/qla_os.c | |
parent | 8bc69e7dc307d6195d92fa87da1fcbae6e5dda69 (diff) |
[SCSI] qla2xxx: Correct reset handling logic.
- honor ISP24XX NVRAM settings for lip-reset, full-login-lip, and
device-reset.
- correct LIP_FULL_LOGIN mailbox command issuance.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 36657fa3aa43..d6445ae841ba 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1037,48 +1037,49 @@ eh_host_reset_lock: | |||
1037 | static int | 1037 | static int |
1038 | qla2x00_loop_reset(scsi_qla_host_t *ha) | 1038 | qla2x00_loop_reset(scsi_qla_host_t *ha) |
1039 | { | 1039 | { |
1040 | int status = QLA_SUCCESS; | 1040 | int ret; |
1041 | struct fc_port *fcport; | 1041 | struct fc_port *fcport; |
1042 | 1042 | ||
1043 | if (ha->flags.enable_lip_full_login) { | ||
1044 | ret = qla2x00_full_login_lip(ha); | ||
1045 | if (ret != QLA_SUCCESS) { | ||
1046 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " | ||
1047 | "full_login_lip=%d.\n", __func__, ha->host_no, | ||
1048 | ret)); | ||
1049 | } | ||
1050 | atomic_set(&ha->loop_state, LOOP_DOWN); | ||
1051 | atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); | ||
1052 | qla2x00_mark_all_devices_lost(ha, 0); | ||
1053 | qla2x00_wait_for_loop_ready(ha); | ||
1054 | } | ||
1055 | |||
1043 | if (ha->flags.enable_lip_reset) { | 1056 | if (ha->flags.enable_lip_reset) { |
1044 | status = qla2x00_lip_reset(ha); | 1057 | ret = qla2x00_lip_reset(ha); |
1058 | if (ret != QLA_SUCCESS) { | ||
1059 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " | ||
1060 | "lip_reset=%d.\n", __func__, ha->host_no, ret)); | ||
1061 | } | ||
1062 | qla2x00_wait_for_loop_ready(ha); | ||
1045 | } | 1063 | } |
1046 | 1064 | ||
1047 | if (status == QLA_SUCCESS && ha->flags.enable_target_reset) { | 1065 | if (ha->flags.enable_target_reset) { |
1048 | list_for_each_entry(fcport, &ha->fcports, list) { | 1066 | list_for_each_entry(fcport, &ha->fcports, list) { |
1049 | if (fcport->port_type != FCT_TARGET) | 1067 | if (fcport->port_type != FCT_TARGET) |
1050 | continue; | 1068 | continue; |
1051 | 1069 | ||
1052 | status = qla2x00_device_reset(ha, fcport); | 1070 | ret = qla2x00_device_reset(ha, fcport); |
1053 | if (status != QLA_SUCCESS) | 1071 | if (ret != QLA_SUCCESS) { |
1054 | break; | 1072 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " |
1073 | "target_reset=%d d_id=%x.\n", __func__, | ||
1074 | ha->host_no, ret, fcport->d_id.b24)); | ||
1075 | } | ||
1055 | } | 1076 | } |
1056 | } | 1077 | } |
1057 | 1078 | ||
1058 | if (status == QLA_SUCCESS && | ||
1059 | ((!ha->flags.enable_target_reset && | ||
1060 | !ha->flags.enable_lip_reset) || | ||
1061 | ha->flags.enable_lip_full_login)) { | ||
1062 | |||
1063 | status = qla2x00_full_login_lip(ha); | ||
1064 | } | ||
1065 | |||
1066 | /* Issue marker command only when we are going to start the I/O */ | 1079 | /* Issue marker command only when we are going to start the I/O */ |
1067 | ha->marker_needed = 1; | 1080 | ha->marker_needed = 1; |
1068 | 1081 | ||
1069 | if (status) { | 1082 | return QLA_SUCCESS; |
1070 | /* Empty */ | ||
1071 | DEBUG2_3(printk("%s(%ld): **** FAILED ****\n", | ||
1072 | __func__, | ||
1073 | ha->host_no)); | ||
1074 | } else { | ||
1075 | /* Empty */ | ||
1076 | DEBUG3(printk("%s(%ld): exiting normally.\n", | ||
1077 | __func__, | ||
1078 | ha->host_no)); | ||
1079 | } | ||
1080 | |||
1081 | return(status); | ||
1082 | } | 1083 | } |
1083 | 1084 | ||
1084 | /* | 1085 | /* |