]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/scsi/ibmvscsi/ibmvfc.c
[SCSI] ibmvfc: Fix another hang on module removal
[net-next-2.6.git] / drivers / scsi / ibmvscsi / ibmvfc.c
index ae560bc04f9d4df009ad8aef36abfa288dfca2f2..ee11568d581f9f0e9bfa617eb6b37f04b6595d2e 100644 (file)
@@ -1059,9 +1059,10 @@ static void ibmvfc_get_starget_port_id(struct scsi_target *starget)
 static int ibmvfc_wait_while_resetting(struct ibmvfc_host *vhost)
 {
        long timeout = wait_event_timeout(vhost->init_wait_q,
-                                         (vhost->state == IBMVFC_ACTIVE ||
-                                          vhost->state == IBMVFC_HOST_OFFLINE ||
-                                          vhost->state == IBMVFC_LINK_DEAD),
+                                         ((vhost->state == IBMVFC_ACTIVE ||
+                                           vhost->state == IBMVFC_HOST_OFFLINE ||
+                                           vhost->state == IBMVFC_LINK_DEAD) &&
+                                          vhost->action == IBMVFC_HOST_ACTION_NONE),
                                          (init_timeout * HZ));
 
        return timeout ? 0 : -EIO;