mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
[SCSI] qla4xxx: added new function qla4xxx_relogin_all_devices
Move relogin to all devices code from do_dpc to new fuction qla4xxx_relogin_all_devices() 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>
This commit is contained in:
parent
3038727c83
commit
2d7924e6be
1 changed files with 23 additions and 31 deletions
|
@ -1218,6 +1218,27 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void qla4xxx_relogin_all_devices(struct scsi_qla_host *ha)
|
||||||
|
{
|
||||||
|
struct ddb_entry *ddb_entry, *dtemp;
|
||||||
|
|
||||||
|
list_for_each_entry_safe(ddb_entry, dtemp, &ha->ddb_list, list) {
|
||||||
|
if ((atomic_read(&ddb_entry->state) == DDB_STATE_MISSING) ||
|
||||||
|
(atomic_read(&ddb_entry->state) == DDB_STATE_DEAD)) {
|
||||||
|
if (ddb_entry->fw_ddb_device_state ==
|
||||||
|
DDB_DS_SESSION_ACTIVE) {
|
||||||
|
atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
|
||||||
|
ql4_printk(KERN_INFO, ha, "scsi%ld: %s: ddb[%d]"
|
||||||
|
" marked ONLINE\n", ha->host_no, __func__,
|
||||||
|
ddb_entry->fw_ddb_index);
|
||||||
|
|
||||||
|
iscsi_unblock_session(ddb_entry->sess);
|
||||||
|
} else
|
||||||
|
qla4xxx_relogin_device(ha, ddb_entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void qla4xxx_wake_dpc(struct scsi_qla_host *ha)
|
void qla4xxx_wake_dpc(struct scsi_qla_host *ha)
|
||||||
{
|
{
|
||||||
if (ha->dpc_thread &&
|
if (ha->dpc_thread &&
|
||||||
|
@ -1326,13 +1347,7 @@ static void qla4xxx_do_dpc(struct work_struct *work)
|
||||||
if (test_and_clear_bit(DPC_LINK_CHANGED, &ha->dpc_flags)) {
|
if (test_and_clear_bit(DPC_LINK_CHANGED, &ha->dpc_flags)) {
|
||||||
if (!test_bit(AF_LINK_UP, &ha->flags)) {
|
if (!test_bit(AF_LINK_UP, &ha->flags)) {
|
||||||
/* ---- link down? --- */
|
/* ---- link down? --- */
|
||||||
list_for_each_entry_safe(ddb_entry, dtemp,
|
qla4xxx_mark_all_devices_missing(ha);
|
||||||
&ha->ddb_list, list) {
|
|
||||||
if (atomic_read(&ddb_entry->state) ==
|
|
||||||
DDB_STATE_ONLINE)
|
|
||||||
qla4xxx_mark_device_missing(ha,
|
|
||||||
ddb_entry);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* ---- link up? --- *
|
/* ---- link up? --- *
|
||||||
* F/W will auto login to all devices ONLY ONCE after
|
* F/W will auto login to all devices ONLY ONCE after
|
||||||
|
@ -1341,30 +1356,7 @@ static void qla4xxx_do_dpc(struct work_struct *work)
|
||||||
* manually relogin to devices when recovering from
|
* manually relogin to devices when recovering from
|
||||||
* connection failures, logouts, expired KATO, etc. */
|
* connection failures, logouts, expired KATO, etc. */
|
||||||
|
|
||||||
list_for_each_entry_safe(ddb_entry, dtemp,
|
qla4xxx_relogin_all_devices(ha);
|
||||||
&ha->ddb_list, list) {
|
|
||||||
if ((atomic_read(&ddb_entry->state) ==
|
|
||||||
DDB_STATE_MISSING) ||
|
|
||||||
(atomic_read(&ddb_entry->state) ==
|
|
||||||
DDB_STATE_DEAD)) {
|
|
||||||
if (ddb_entry->fw_ddb_device_state ==
|
|
||||||
DDB_DS_SESSION_ACTIVE) {
|
|
||||||
atomic_set(&ddb_entry->state,
|
|
||||||
DDB_STATE_ONLINE);
|
|
||||||
ql4_printk(KERN_INFO, ha,
|
|
||||||
"scsi%ld: %s: ddb[%d]"
|
|
||||||
" marked ONLINE\n",
|
|
||||||
ha->host_no, __func__,
|
|
||||||
ddb_entry->fw_ddb_index);
|
|
||||||
|
|
||||||
iscsi_unblock_session(
|
|
||||||
ddb_entry->sess);
|
|
||||||
} else
|
|
||||||
qla4xxx_relogin_device(
|
|
||||||
ha, ddb_entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue