Commit 65be55a7 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[PATCH] PATCH [12/15] qla2xxx: Restore update state during resync

Restore the UPDATE state of the HA if a resync event occurs during
a device (re)discovery.
parent d6aa0d11
......@@ -1497,7 +1497,7 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
{
int rval;
uint8_t rval1 = 0;
static unsigned long flags, save_flags;
unsigned long flags, save_flags;
rval = QLA_SUCCESS;
......@@ -1597,6 +1597,14 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
DEBUG3(printk("%s: exiting normally\n", __func__));
}
/* Restore state if a resync event occured during processing */
if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
if (test_bit(LOCAL_LOOP_UPDATE, &save_flags))
set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
if (test_bit(RSCN_UPDATE, &save_flags))
set_bit(RSCN_UPDATE, &ha->dpc_flags);
}
return (rval);
}
......@@ -1805,6 +1813,20 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
return (rval);
}
static void
qla2x00_probe_for_all_luns(scsi_qla_host_t *ha)
{
fc_port_t *fcport;
qla2x00_mark_all_devices_lost(ha);
list_for_each_entry(fcport, &ha->fcports, list) {
if (fcport->port_type != FCT_TARGET)
continue;
qla2x00_update_fcport(ha, fcport);
}
}
/*
* qla2x00_update_fcport
* Updates device on list.
......@@ -3194,6 +3216,7 @@ qla2x00_rescan_fcports(scsi_qla_host_t *ha)
rescan_done = 1;
}
qla2x00_probe_for_all_luns(ha);
/* Update OS target and lun structures if necessary. */
if (rescan_done) {
......
......@@ -452,6 +452,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint32_t mbx)
if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
atomic_set(&ha->loop_state, LOOP_DOWN);
atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
ha->device_flags |= DFLG_NO_CABLE;
qla2x00_mark_all_devices_lost(ha);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment