aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2008-08-15 11:59:21 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-08-16 11:47:46 -0400
commit3eddc569770a76f2ca65621cdde3c0a2552b5b0c (patch)
treeacea9c8f9985dcac6630dc622d6682da55a2837a
parent004dd5e88673516a408f0e8e43edbe6a4424be2f (diff)
[SCSI] ibmvfc: Fix another hang on module removal
This fixes a hang on module removal. The module removal code was setting the hosts's state to IBMVFC_HOST_OFFLINE before tearing down the kernel thread, but, due to a bug in ibmvfc_wait_while_resetting, was not waiting for the kernel thread's offlining work to be done prior to destroying the kernel thread, which left the scsi host in a blocked state which we never got out of. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index ae560bc04f9d..ee11568d581f 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -1059,9 +1059,10 @@ static void ibmvfc_get_starget_port_id(struct scsi_target *starget)
1059static int ibmvfc_wait_while_resetting(struct ibmvfc_host *vhost) 1059static int ibmvfc_wait_while_resetting(struct ibmvfc_host *vhost)
1060{ 1060{
1061 long timeout = wait_event_timeout(vhost->init_wait_q, 1061 long timeout = wait_event_timeout(vhost->init_wait_q,
1062 (vhost->state == IBMVFC_ACTIVE || 1062 ((vhost->state == IBMVFC_ACTIVE ||
1063 vhost->state == IBMVFC_HOST_OFFLINE || 1063 vhost->state == IBMVFC_HOST_OFFLINE ||
1064 vhost->state == IBMVFC_LINK_DEAD), 1064 vhost->state == IBMVFC_LINK_DEAD) &&
1065 vhost->action == IBMVFC_HOST_ACTION_NONE),
1065 (init_timeout * HZ)); 1066 (init_timeout * HZ));
1066 1067
1067 return timeout ? 0 : -EIO; 1068 return timeout ? 0 : -EIO;