aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorNilesh Javali <nilesh.javali@qlogic.com>2011-12-19 00:40:44 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-01-10 18:01:22 -0500
commitc28eaaca7acea214937fb9b3ae45e001d49947bf (patch)
tree68810f9b907fce5e408948722486d28f502c8795 /drivers/scsi/qla4xxx
parent4a4bc2e90c1c689bf929914256310361d4012df1 (diff)
[SCSI] qla4xxx: Limit the ACB Default Timeout value to 12s
A wrong default timeout value programmed in the adapter causes driver to wait for that much time while waiting for target discoveries to complete. This could add huge delays during the driver load time. To avoid this, limit the default timeout value to 12 seconds if the default timeout value set in adapter is less than 12 seconds and greater than 120 seconds. Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 87e3699d7ea2..09b28f8513a0 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1630,7 +1630,9 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
1630 1630
1631 /* Update timers after login */ 1631 /* Update timers after login */
1632 ddb_entry->default_relogin_timeout = 1632 ddb_entry->default_relogin_timeout =
1633 le16_to_cpu(fw_ddb_entry->def_timeout); 1633 (le16_to_cpu(fw_ddb_entry->def_timeout) > LOGIN_TOV) &&
1634 (le16_to_cpu(fw_ddb_entry->def_timeout) < LOGIN_TOV * 10) ?
1635 le16_to_cpu(fw_ddb_entry->def_timeout) : LOGIN_TOV;
1634 ddb_entry->default_time2wait = 1636 ddb_entry->default_time2wait =
1635 le16_to_cpu(fw_ddb_entry->iscsi_def_time2wait); 1637 le16_to_cpu(fw_ddb_entry->iscsi_def_time2wait);
1636 1638
@@ -3882,6 +3884,8 @@ static int qla4xxx_verify_boot_idx(struct scsi_qla_host *ha, uint16_t idx)
3882static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha, 3884static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
3883 struct ddb_entry *ddb_entry) 3885 struct ddb_entry *ddb_entry)
3884{ 3886{
3887 uint16_t def_timeout;
3888
3885 ddb_entry->ddb_type = FLASH_DDB; 3889 ddb_entry->ddb_type = FLASH_DDB;
3886 ddb_entry->fw_ddb_index = INVALID_ENTRY; 3890 ddb_entry->fw_ddb_index = INVALID_ENTRY;
3887 ddb_entry->fw_ddb_device_state = DDB_DS_NO_CONNECTION_ACTIVE; 3891 ddb_entry->fw_ddb_device_state = DDB_DS_NO_CONNECTION_ACTIVE;
@@ -3892,9 +3896,10 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
3892 atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY); 3896 atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
3893 atomic_set(&ddb_entry->relogin_timer, 0); 3897 atomic_set(&ddb_entry->relogin_timer, 0);
3894 atomic_set(&ddb_entry->relogin_retry_count, 0); 3898 atomic_set(&ddb_entry->relogin_retry_count, 0);
3895 3899 def_timeout = le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout);
3896 ddb_entry->default_relogin_timeout = 3900 ddb_entry->default_relogin_timeout =
3897 le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout); 3901 (def_timeout > LOGIN_TOV) && (def_timeout < LOGIN_TOV * 10) ?
3902 def_timeout : LOGIN_TOV;
3898 ddb_entry->default_time2wait = 3903 ddb_entry->default_time2wait =
3899 le16_to_cpu(ddb_entry->fw_ddb_entry.iscsi_def_time2wait); 3904 le16_to_cpu(ddb_entry->fw_ddb_entry.iscsi_def_time2wait);
3900} 3905}
@@ -4228,7 +4233,10 @@ void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset)
4228 } 4233 }
4229 4234
4230 /* Wait to ensure all sendtargets are done for min 12 sec wait */ 4235 /* Wait to ensure all sendtargets are done for min 12 sec wait */
4231 tmo = ((ha->def_timeout < LOGIN_TOV) ? LOGIN_TOV : ha->def_timeout); 4236 tmo = ((ha->def_timeout > LOGIN_TOV) &&
4237 (ha->def_timeout < LOGIN_TOV * 10) ?
4238 ha->def_timeout : LOGIN_TOV);
4239
4232 DEBUG2(ql4_printk(KERN_INFO, ha, 4240 DEBUG2(ql4_printk(KERN_INFO, ha,
4233 "Default time to wait for build ddb %d\n", tmo)); 4241 "Default time to wait for build ddb %d\n", tmo));
4234 4242