diff options
author | Michael S. Tsirkin <mst@mellanox.co.il> | 2005-11-29 13:18:45 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2005-11-29 13:18:45 -0500 |
commit | de922487890936470660e89f9095aee980637989 (patch) | |
tree | bbb88a18ee78fa43c0f887c138011a055a9c8045 /drivers/infiniband | |
parent | 5872a9fc28e6cd3a4e51479a50970d19a01573b3 (diff) |
IPoIB: reinitialize mcast structs' completions for every query
Make sure mcast->done is initialized to uncompleted value before we
submit a new query, so that it's safe to wait on.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index c33ed87f9dff..10404e09d1ef 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -135,8 +135,6 @@ static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev, | |||
135 | if (!mcast) | 135 | if (!mcast) |
136 | return NULL; | 136 | return NULL; |
137 | 137 | ||
138 | init_completion(&mcast->done); | ||
139 | |||
140 | mcast->dev = dev; | 138 | mcast->dev = dev; |
141 | mcast->created = jiffies; | 139 | mcast->created = jiffies; |
142 | mcast->backoff = 1; | 140 | mcast->backoff = 1; |
@@ -350,6 +348,8 @@ static int ipoib_mcast_sendonly_join(struct ipoib_mcast *mcast) | |||
350 | rec.port_gid = priv->local_gid; | 348 | rec.port_gid = priv->local_gid; |
351 | rec.pkey = cpu_to_be16(priv->pkey); | 349 | rec.pkey = cpu_to_be16(priv->pkey); |
352 | 350 | ||
351 | init_completion(&mcast->done); | ||
352 | |||
353 | ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec, | 353 | ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec, |
354 | IB_SA_MCMEMBER_REC_MGID | | 354 | IB_SA_MCMEMBER_REC_MGID | |
355 | IB_SA_MCMEMBER_REC_PORT_GID | | 355 | IB_SA_MCMEMBER_REC_PORT_GID | |
@@ -469,6 +469,8 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast, | |||
469 | rec.traffic_class = priv->broadcast->mcmember.traffic_class; | 469 | rec.traffic_class = priv->broadcast->mcmember.traffic_class; |
470 | } | 470 | } |
471 | 471 | ||
472 | init_completion(&mcast->done); | ||
473 | |||
472 | ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec, comp_mask, | 474 | ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec, comp_mask, |
473 | mcast->backoff * 1000, GFP_ATOMIC, | 475 | mcast->backoff * 1000, GFP_ATOMIC, |
474 | ipoib_mcast_join_complete, | 476 | ipoib_mcast_join_complete, |