aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2010-07-30 04:55:46 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-08-06 12:56:04 -0400
commit3013cea83ef3532e49b973a0bc9b3562f56871c6 (patch)
tree14371e9c379b1fb1fa31e7568ade52f203c73cf8
parentbe948fc30dabc347e4fba4daf4da9fd83d2abf49 (diff)
[SCSI] qla4xxx: set correct value in sess->recovery_tmo
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: Ravi Anand <ravi.anand@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h5
-rw-r--r--drivers/scsi/qla4xxx/ql4_init.c3
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c1
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c7
4 files changed, 7 insertions, 9 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index a79da8dd2064..6af5d04c5290 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -137,6 +137,9 @@
137#define ISCSI_ALIAS_SIZE 32 /* ISCSI Alias name size */ 137#define ISCSI_ALIAS_SIZE 32 /* ISCSI Alias name size */
138#define ISCSI_NAME_SIZE 0xE0 /* ISCSI Name size */ 138#define ISCSI_NAME_SIZE 0xE0 /* ISCSI Name size */
139 139
140#define QL4_SESS_RECOVERY_TMO 30 /* iSCSI session */
141 /* recovery timeout */
142
140#define LSDW(x) ((u32)((u64)(x))) 143#define LSDW(x) ((u32)((u64)(x)))
141#define MSDW(x) ((u32)((((u64)(x)) >> 16) >> 16)) 144#define MSDW(x) ((u32)((((u64)(x)) >> 16) >> 16))
142 145
@@ -249,7 +252,6 @@ struct ddb_entry {
249 uint32_t default_time2wait; /* Default Min time between 252 uint32_t default_time2wait; /* Default Min time between
250 * relogins (+aens) */ 253 * relogins (+aens) */
251 254
252 atomic_t port_down_timer; /* Device connection timer */
253 atomic_t retry_relogin_timer; /* Min Time between relogins 255 atomic_t retry_relogin_timer; /* Min Time between relogins
254 * (4000 only) */ 256 * (4000 only) */
255 atomic_t relogin_timer; /* Max Time to wait for relogin to complete */ 257 atomic_t relogin_timer; /* Max Time to wait for relogin to complete */
@@ -474,7 +476,6 @@ struct scsi_qla_host {
474 uint32_t timer_active; 476 uint32_t timer_active;
475 477
476 /* Recovery Timers */ 478 /* Recovery Timers */
477 uint32_t port_down_retry_count;
478 uint32_t discovery_wait; 479 uint32_t discovery_wait;
479 atomic_t check_relogin_timeouts; 480 atomic_t check_relogin_timeouts;
480 uint32_t retry_reset_ha_cnt; 481 uint32_t retry_reset_ha_cnt;
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 30073577c3a4..b69c5736cb43 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -669,7 +669,6 @@ static struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha,
669 } 669 }
670 670
671 ddb_entry->fw_ddb_index = fw_ddb_index; 671 ddb_entry->fw_ddb_index = fw_ddb_index;
672 atomic_set(&ddb_entry->port_down_timer, ha->port_down_retry_count);
673 atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY); 672 atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
674 atomic_set(&ddb_entry->relogin_timer, 0); 673 atomic_set(&ddb_entry->relogin_timer, 0);
675 atomic_set(&ddb_entry->relogin_retry_count, 0); 674 atomic_set(&ddb_entry->relogin_retry_count, 0);
@@ -1556,8 +1555,6 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
1556 /* Device is back online. */ 1555 /* Device is back online. */
1557 if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) { 1556 if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) {
1558 atomic_set(&ddb_entry->state, DDB_STATE_ONLINE); 1557 atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
1559 atomic_set(&ddb_entry->port_down_timer,
1560 ha->port_down_retry_count);
1561 atomic_set(&ddb_entry->relogin_retry_count, 0); 1558 atomic_set(&ddb_entry->relogin_retry_count, 0);
1562 atomic_set(&ddb_entry->relogin_timer, 0); 1559 atomic_set(&ddb_entry->relogin_timer, 0);
1563 clear_bit(DF_RELOGIN, &ddb_entry->flags); 1560 clear_bit(DF_RELOGIN, &ddb_entry->flags);
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 940ee561ee0a..c4e036b449c2 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -361,7 +361,6 @@ qla4xxx_update_local_ifcb(struct scsi_qla_host *ha,
361 min(sizeof(ha->alias), sizeof(init_fw_cb->Alias)));*/ 361 min(sizeof(ha->alias), sizeof(init_fw_cb->Alias)));*/
362 362
363 /* Save Command Line Paramater info */ 363 /* Save Command Line Paramater info */
364 ha->port_down_retry_count = le16_to_cpu(init_fw_cb->conn_ka_timeout);
365 ha->discovery_wait = ql4xdiscoverywait; 364 ha->discovery_wait = ql4xdiscoverywait;
366 365
367 if (ha->acb_version == ACB_SUPPORTED) { 366 if (ha->acb_version == ACB_SUPPORTED) {
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 5529b2a39741..fd1af23e6801 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -163,10 +163,10 @@ static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session)
163 if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) { 163 if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) {
164 atomic_set(&ddb_entry->state, DDB_STATE_DEAD); 164 atomic_set(&ddb_entry->state, DDB_STATE_DEAD);
165 165
166 DEBUG2(printk("scsi%ld: %s: ddb [%d] port down retry count " 166 DEBUG2(printk("scsi%ld: %s: ddb [%d] session recovery timeout "
167 "of (%d) secs exhausted, marking device DEAD.\n", 167 "of (%d) secs exhausted, marking device DEAD.\n",
168 ha->host_no, __func__, ddb_entry->fw_ddb_index, 168 ha->host_no, __func__, ddb_entry->fw_ddb_index,
169 ha->port_down_retry_count)); 169 QL4_SESS_RECOVERY_TMO));
170 170
171 qla4xxx_wake_dpc(ha); 171 qla4xxx_wake_dpc(ha);
172 } 172 }
@@ -298,7 +298,8 @@ int qla4xxx_add_sess(struct ddb_entry *ddb_entry)
298{ 298{
299 int err; 299 int err;
300 300
301 ddb_entry->sess->recovery_tmo = ddb_entry->ha->port_down_retry_count; 301 ddb_entry->sess->recovery_tmo = QL4_SESS_RECOVERY_TMO;
302
302 err = iscsi_add_session(ddb_entry->sess, ddb_entry->fw_ddb_index); 303 err = iscsi_add_session(ddb_entry->sess, ddb_entry->fw_ddb_index);
303 if (err) { 304 if (err) {
304 DEBUG2(printk(KERN_ERR "Could not add session.\n")); 305 DEBUG2(printk(KERN_ERR "Could not add session.\n"));