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 | |
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')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 10 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 55 |
3 files changed, 38 insertions, 35 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index bd3284834cd7..b3dac26ddba3 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -3476,9 +3476,11 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) | |||
3476 | 3476 | ||
3477 | /* Set host adapter parameters. */ | 3477 | /* Set host adapter parameters. */ |
3478 | ha->flags.disable_risc_code_load = 0; | 3478 | ha->flags.disable_risc_code_load = 0; |
3479 | ha->flags.enable_lip_reset = 1; | 3479 | ha->flags.enable_lip_reset = 0; |
3480 | ha->flags.enable_lip_full_login = 1; | 3480 | ha->flags.enable_lip_full_login = |
3481 | ha->flags.enable_target_reset = 1; | 3481 | le32_to_cpu(nv->host_p) & BIT_10 ? 1: 0; |
3482 | ha->flags.enable_target_reset = | ||
3483 | le32_to_cpu(nv->host_p) & BIT_11 ? 1: 0; | ||
3482 | ha->flags.enable_led_scheme = 0; | 3484 | ha->flags.enable_led_scheme = 0; |
3483 | ha->flags.disable_serdes = le32_to_cpu(nv->host_p) & BIT_5 ? 1: 0; | 3485 | ha->flags.disable_serdes = le32_to_cpu(nv->host_p) & BIT_5 ? 1: 0; |
3484 | 3486 | ||
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index afe7310213cc..077e5789beeb 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -1339,9 +1339,9 @@ qla2x00_lip_reset(scsi_qla_host_t *ha) | |||
1339 | 1339 | ||
1340 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { | 1340 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { |
1341 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; | 1341 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; |
1342 | mcp->mb[1] = BIT_0; | 1342 | mcp->mb[1] = BIT_6; |
1343 | mcp->mb[2] = 0xff; | 1343 | mcp->mb[2] = 0; |
1344 | mcp->mb[3] = 0; | 1344 | mcp->mb[3] = ha->loop_reset_delay; |
1345 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; | 1345 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; |
1346 | } else { | 1346 | } else { |
1347 | mcp->mb[0] = MBC_LIP_RESET; | 1347 | mcp->mb[0] = MBC_LIP_RESET; |
@@ -1823,8 +1823,8 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha) | |||
1823 | ha->host_no)); | 1823 | ha->host_no)); |
1824 | 1824 | ||
1825 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; | 1825 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; |
1826 | mcp->mb[1] = 0; | 1826 | mcp->mb[1] = IS_QLA24XX(ha) || IS_QLA54XX(ha) ? BIT_3: 0; |
1827 | mcp->mb[2] = 0xff; | 1827 | mcp->mb[2] = 0; |
1828 | mcp->mb[3] = 0; | 1828 | mcp->mb[3] = 0; |
1829 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; | 1829 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; |
1830 | mcp->in_mb = MBX_0; | 1830 | mcp->in_mb = MBX_0; |
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 | /* |