scsi: qla2xxx: Add timeout ability to wait_for_sess_deletion().
authorJoe Carnuccio <joe.carnuccio@cavium.com>
Wed, 23 Aug 2017 22:05:11 +0000 (15:05 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 02:29:26 +0000 (22:29 -0400)
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_target.c

index 10c3ee53ec3a639c121761c191fcfa01d2a02116..c217cec4dd49e69aed01bb5e79b47c57bf321712 100644 (file)
@@ -1141,7 +1141,7 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha)
 {
        qla2x00_mark_all_devices_lost(vha, 0);
 
-       wait_event(vha->fcport_waitQ, test_fcport_count(vha));
+       wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha), 10*HZ);
 }
 
 /*
index 3bcfbee2ae265299483b4ee07e4c7d9fff9f55f6..6a6d9db6479f83fdf9d698175503ed1c08b278f6 100644 (file)
@@ -1479,7 +1479,7 @@ int qlt_stop_phase1(struct qla_tgt *tgt)
        ql_dbg(ql_dbg_tgt_mgt, vha, 0xf00a,
            "Waiting for tgt %p: sess_count=%d\n", tgt, tgt->sess_count);
 
-       wait_event(tgt->waitQ, test_tgt_sess_count(tgt));
+       wait_event_timeout(tgt->waitQ, test_tgt_sess_count(tgt), 10*HZ);
 
        /* Big hammer */
        if (!ha->flags.host_shutting_down &&
@@ -1487,7 +1487,7 @@ int qlt_stop_phase1(struct qla_tgt *tgt)
                qlt_disable_vha(vha);
 
        /* Wait for sessions to clear out (just in case) */
-       wait_event(tgt->waitQ, test_tgt_sess_count(tgt));
+       wait_event_timeout(tgt->waitQ, test_tgt_sess_count(tgt), 10*HZ);
        return 0;
 }
 EXPORT_SYMBOL(qlt_stop_phase1);