diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2011-03-21 06:34:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-03-23 13:53:01 -0400 |
commit | fc7657c9d98c250c9fd212348e6e156c73885cc4 (patch) | |
tree | 6d5862fd16a921b0d2e63b10c0f2411500caf439 /drivers/scsi | |
parent | 7eece5a084264c1bff908b0d6a1b176b39dd272f (diff) |
[SCSI] qla4xxx: cleanup function qla4xxx_process_ddb_changed
We don't need to check ddb old state we can take action
based on ddb new state.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_init.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index 8b5453a60444..bbb2e903d38a 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c | |||
@@ -1409,7 +1409,6 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index, | |||
1409 | uint32_t state, uint32_t conn_err) | 1409 | uint32_t state, uint32_t conn_err) |
1410 | { | 1410 | { |
1411 | struct ddb_entry * ddb_entry; | 1411 | struct ddb_entry * ddb_entry; |
1412 | uint32_t old_fw_ddb_device_state; | ||
1413 | 1412 | ||
1414 | /* check for out of range index */ | 1413 | /* check for out of range index */ |
1415 | if (fw_ddb_index >= MAX_DDB_ENTRIES) | 1414 | if (fw_ddb_index >= MAX_DDB_ENTRIES) |
@@ -1425,22 +1424,14 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index, | |||
1425 | } | 1424 | } |
1426 | 1425 | ||
1427 | /* Device already exists in our database. */ | 1426 | /* Device already exists in our database. */ |
1428 | old_fw_ddb_device_state = ddb_entry->fw_ddb_device_state; | ||
1429 | DEBUG2(printk("scsi%ld: %s DDB - old state= 0x%x, new state=0x%x for " | 1427 | DEBUG2(printk("scsi%ld: %s DDB - old state= 0x%x, new state=0x%x for " |
1430 | "index [%d]\n", ha->host_no, __func__, | 1428 | "index [%d]\n", ha->host_no, __func__, |
1431 | ddb_entry->fw_ddb_device_state, state, fw_ddb_index)); | 1429 | ddb_entry->fw_ddb_device_state, state, fw_ddb_index)); |
1432 | if (old_fw_ddb_device_state == state && | ||
1433 | state == DDB_DS_SESSION_ACTIVE) { | ||
1434 | if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) { | ||
1435 | atomic_set(&ddb_entry->state, DDB_STATE_ONLINE); | ||
1436 | iscsi_unblock_session(ddb_entry->sess); | ||
1437 | } | ||
1438 | return QLA_SUCCESS; | ||
1439 | } | ||
1440 | 1430 | ||
1441 | ddb_entry->fw_ddb_device_state = state; | 1431 | ddb_entry->fw_ddb_device_state = state; |
1442 | /* Device is back online. */ | 1432 | /* Device is back online. */ |
1443 | if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) { | 1433 | if ((ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) && |
1434 | (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE)) { | ||
1444 | atomic_set(&ddb_entry->state, DDB_STATE_ONLINE); | 1435 | atomic_set(&ddb_entry->state, DDB_STATE_ONLINE); |
1445 | atomic_set(&ddb_entry->relogin_retry_count, 0); | 1436 | atomic_set(&ddb_entry->relogin_retry_count, 0); |
1446 | atomic_set(&ddb_entry->relogin_timer, 0); | 1437 | atomic_set(&ddb_entry->relogin_timer, 0); |
@@ -1452,7 +1443,7 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index, | |||
1452 | * Change the lun state to READY in case the lun TIMEOUT before | 1443 | * Change the lun state to READY in case the lun TIMEOUT before |
1453 | * the device came back. | 1444 | * the device came back. |
1454 | */ | 1445 | */ |
1455 | } else { | 1446 | } else if (ddb_entry->fw_ddb_device_state != DDB_DS_SESSION_ACTIVE) { |
1456 | /* Device went away, mark device missing */ | 1447 | /* Device went away, mark device missing */ |
1457 | if (atomic_read(&ddb_entry->state) == DDB_STATE_ONLINE) { | 1448 | if (atomic_read(&ddb_entry->state) == DDB_STATE_ONLINE) { |
1458 | DEBUG2(ql4_printk(KERN_INFO, ha, "%s mark missing " | 1449 | DEBUG2(ql4_printk(KERN_INFO, ha, "%s mark missing " |