Commit 5de1f70f authored by Seokmann Ju's avatar Seokmann Ju Committed by James Bottomley

[SCSI] qla2xxx: Correct rport/fcport visibility-state handling during loop-resync.

There were several issues here, one, during RSCN handling if a
follow-on RSCN occurred (within interrupt context) the DPC thread
could inadvertantly leave the fcport in a stale lost state.
Secondly, scheduled rport removal is handled exclusively by the
'parent' DPC thread, so wake up the proper thread.  Finally,
process vport loop-resync's only when the vport has in an
"active" state (ID acquired).
Signed-off-by: default avatarSeokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent da57bf8f
...@@ -2012,9 +2012,11 @@ qla2x00_configure_loop(scsi_qla_host_t *ha) ...@@ -2012,9 +2012,11 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) { if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
if (test_bit(LOCAL_LOOP_UPDATE, &save_flags)) if (test_bit(LOCAL_LOOP_UPDATE, &save_flags))
set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
if (test_bit(RSCN_UPDATE, &save_flags)) if (test_bit(RSCN_UPDATE, &save_flags)) {
ha->flags.rscn_queue_overflow = 1;
set_bit(RSCN_UPDATE, &ha->dpc_flags); set_bit(RSCN_UPDATE, &ha->dpc_flags);
} }
}
return (rval); return (rval);
} }
......
...@@ -277,7 +277,8 @@ qla2x00_do_dpc_vp(scsi_qla_host_t *vha) ...@@ -277,7 +277,8 @@ qla2x00_do_dpc_vp(scsi_qla_host_t *vha)
clear_bit(RESET_ACTIVE, &vha->dpc_flags); clear_bit(RESET_ACTIVE, &vha->dpc_flags);
} }
if (test_and_clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { if (atomic_read(&vha->vp_state) == VP_ACTIVE &&
test_and_clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) {
if (!(test_and_set_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags))) { if (!(test_and_set_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags))) {
qla2x00_loop_resync(vha); qla2x00_loop_resync(vha);
clear_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags); clear_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags);
......
...@@ -1849,6 +1849,7 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport, ...@@ -1849,6 +1849,7 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
int defer) int defer)
{ {
struct fc_rport *rport; struct fc_rport *rport;
scsi_qla_host_t *pha = to_qla_parent(ha);
if (!fcport->rport) if (!fcport->rport)
return; return;
...@@ -1858,8 +1859,8 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport, ...@@ -1858,8 +1859,8 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
spin_lock_irq(ha->host->host_lock); spin_lock_irq(ha->host->host_lock);
fcport->drport = rport; fcport->drport = rport;
spin_unlock_irq(ha->host->host_lock); spin_unlock_irq(ha->host->host_lock);
set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags); set_bit(FCPORT_UPDATE_NEEDED, &pha->dpc_flags);
qla2xxx_wake_dpc(ha); qla2xxx_wake_dpc(pha);
} else } else
fc_remote_port_delete(rport); fc_remote_port_delete(rport);
} }
......
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