diff options
author | Martin Wilck <mwilck@suse.com> | 2019-11-05 09:56:00 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-11-05 23:55:31 -0500 |
commit | 8b1062d513880b3ec696945f15dc84d179f1f3c1 (patch) | |
tree | 6dc52393d92ebcd7326488d64d78a64bbfce1c5a | |
parent | edc1f5432f450b486091b79697c4ddc7f0f3845a (diff) |
scsi: qla2xxx: fix NPIV tear down process
Fix two issues with commit f5187b7d1ac6 ("scsi: qla2xxx: Optimize NPIV
tear down process"): a missing negation in a wait_event_timeout()
condition, and a missing loop end condition.
Fixes: f5187b7d1ac6 ("scsi: qla2xxx: Optimize NPIV tear down process")
Link: https://lore.kernel.org/r/20191105145550.10268-1-martin.wilck@suse.com
Signed-off-by: Martin Wilck <mwilck@suse.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 6afad68e5ba2..238240984bc1 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -76,9 +76,11 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha) | |||
76 | * ensures no active vp_list traversal while the vport is removed | 76 | * ensures no active vp_list traversal while the vport is removed |
77 | * from the queue) | 77 | * from the queue) |
78 | */ | 78 | */ |
79 | for (i = 0; i < 10 && atomic_read(&vha->vref_count); i++) | 79 | for (i = 0; i < 10; i++) { |
80 | wait_event_timeout(vha->vref_waitq, | 80 | if (wait_event_timeout(vha->vref_waitq, |
81 | atomic_read(&vha->vref_count), HZ); | 81 | !atomic_read(&vha->vref_count), HZ) > 0) |
82 | break; | ||
83 | } | ||
82 | 84 | ||
83 | spin_lock_irqsave(&ha->vport_slock, flags); | 85 | spin_lock_irqsave(&ha->vport_slock, flags); |
84 | if (atomic_read(&vha->vref_count)) { | 86 | if (atomic_read(&vha->vref_count)) { |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 3568031c6504..e6ff17f38178 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1119,9 +1119,11 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha) | |||
1119 | 1119 | ||
1120 | qla2x00_mark_all_devices_lost(vha, 0); | 1120 | qla2x00_mark_all_devices_lost(vha, 0); |
1121 | 1121 | ||
1122 | for (i = 0; i < 10; i++) | 1122 | for (i = 0; i < 10; i++) { |
1123 | wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha), | 1123 | if (wait_event_timeout(vha->fcport_waitQ, |
1124 | HZ); | 1124 | test_fcport_count(vha), HZ) > 0) |
1125 | break; | ||
1126 | } | ||
1125 | 1127 | ||
1126 | flush_workqueue(vha->hw->wq); | 1128 | flush_workqueue(vha->hw->wq); |
1127 | } | 1129 | } |