]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qla4xxx: Correct the default relogin timeout value
authorNilesh Javali <nilesh.javali@qlogic.com>
Wed, 7 Dec 2011 08:22:31 +0000 (13:52 +0530)
committerGuru Anbalagane <guru.anbalagane@oracle.com>
Thu, 12 Jan 2012 22:35:15 +0000 (14:35 -0800)
The ACB default timeout value is used to set the default
relogin timeout value. For ISP4022 adapters where
the ACB default value is set to 2560s, limit the relogin
timeout to 12s.

JIRA Key: IUEKR2ISCSI-8

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
drivers/scsi/qla4xxx/ql4_os.c

index fe53550523251e28c2b92dc0c4849bbb015cd2ac..f05e42ce8754e631b91abf664a3c3245c6b15873 100644 (file)
@@ -1629,7 +1629,9 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
 
        /* Update timers after login */
        ddb_entry->default_relogin_timeout =
-                               le16_to_cpu(fw_ddb_entry->def_timeout);
+               (le16_to_cpu(fw_ddb_entry->def_timeout) > LOGIN_TOV) &&
+               (le16_to_cpu(fw_ddb_entry->def_timeout) < LOGIN_TOV * 10) ?
+               le16_to_cpu(fw_ddb_entry->def_timeout) : LOGIN_TOV;
        ddb_entry->default_time2wait =
                                le16_to_cpu(fw_ddb_entry->iscsi_def_time2wait);
 
@@ -3856,6 +3858,8 @@ static int qla4xxx_verify_boot_idx(struct scsi_qla_host *ha, uint16_t idx)
 static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
                                          struct ddb_entry *ddb_entry)
 {
+       uint16_t def_timeout;
+
        ddb_entry->ddb_type = FLASH_DDB;
        ddb_entry->fw_ddb_index = INVALID_ENTRY;
        ddb_entry->fw_ddb_device_state = DDB_DS_NO_CONNECTION_ACTIVE;
@@ -3867,8 +3871,10 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
        atomic_set(&ddb_entry->relogin_timer, 0);
        atomic_set(&ddb_entry->relogin_retry_count, 0);
 
+       def_timeout = le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout);
        ddb_entry->default_relogin_timeout =
-               le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout);
+               (def_timeout > LOGIN_TOV) && (def_timeout < LOGIN_TOV * 10) ?
+                def_timeout : LOGIN_TOV;
        ddb_entry->default_time2wait =
                le16_to_cpu(ddb_entry->fw_ddb_entry.iscsi_def_time2wait);
 }