Commit 8b1062d5 authored by Martin Wilck's avatar Martin Wilck Committed by Martin K. Petersen

scsi: qla2xxx: fix NPIV tear down process

Fix two issues with commit f5187b7d ("scsi: qla2xxx: Optimize NPIV
tear down process"): a missing negation in a wait_event_timeout()
condition, and a missing loop end condition.

Fixes: f5187b7d ("scsi: qla2xxx: Optimize NPIV tear down process")
Link: https://lore.kernel.org/r/20191105145550.10268-1-martin.wilck@suse.comSigned-off-by: default avatarMartin Wilck <mwilck@suse.com>
Acked-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent edc1f543
...@@ -76,9 +76,11 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha) ...@@ -76,9 +76,11 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
* ensures no active vp_list traversal while the vport is removed * ensures no active vp_list traversal while the vport is removed
* from the queue) * from the queue)
*/ */
for (i = 0; i < 10 && atomic_read(&vha->vref_count); i++) for (i = 0; i < 10; i++) {
wait_event_timeout(vha->vref_waitq, if (wait_event_timeout(vha->vref_waitq,
atomic_read(&vha->vref_count), HZ); !atomic_read(&vha->vref_count), HZ) > 0)
break;
}
spin_lock_irqsave(&ha->vport_slock, flags); spin_lock_irqsave(&ha->vport_slock, flags);
if (atomic_read(&vha->vref_count)) { if (atomic_read(&vha->vref_count)) {
......
...@@ -1119,9 +1119,11 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha) ...@@ -1119,9 +1119,11 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha)
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha, 0);
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++) {
wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha), if (wait_event_timeout(vha->fcport_waitQ,
HZ); test_fcport_count(vha), HZ) > 0)
break;
}
flush_workqueue(vha->hw->wq); flush_workqueue(vha->hw->wq);
} }
......
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