diff options
author | Erez Shitrit <erezsh@mellanox.com> | 2017-07-12 03:40:25 -0400 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2017-07-23 02:45:11 -0400 |
commit | 6bdc8de2e86e717124a715ecc480892a2c331ff5 (patch) | |
tree | e5e845fac6d7fa870454577ec452267a66e2bae7 | |
parent | edf3f301db7af7e784d06f7059dfc8a69359af13 (diff) |
IB/ipoib: Use cancel_delayed_work_sync when needed
The work mcast_task can re-queue itself, so instead of doing
cancel && flush_workqueue, that still can leave a queued task
on the air, use cancel_delayed_work_sync.
Also, no need to use lock over the cancel, the original lock was
due to bit assignment setting (IPOIB_MCAST_RUN) that is not in use
anymore.
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 0a0b2ce45cbc..f80bf0f5d7cf 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -684,15 +684,10 @@ void ipoib_mcast_start_thread(struct net_device *dev) | |||
684 | int ipoib_mcast_stop_thread(struct net_device *dev) | 684 | int ipoib_mcast_stop_thread(struct net_device *dev) |
685 | { | 685 | { |
686 | struct ipoib_dev_priv *priv = ipoib_priv(dev); | 686 | struct ipoib_dev_priv *priv = ipoib_priv(dev); |
687 | unsigned long flags; | ||
688 | 687 | ||
689 | ipoib_dbg_mcast(priv, "stopping multicast thread\n"); | 688 | ipoib_dbg_mcast(priv, "stopping multicast thread\n"); |
690 | 689 | ||
691 | spin_lock_irqsave(&priv->lock, flags); | 690 | cancel_delayed_work_sync(&priv->mcast_task); |
692 | cancel_delayed_work(&priv->mcast_task); | ||
693 | spin_unlock_irqrestore(&priv->lock, flags); | ||
694 | |||
695 | flush_workqueue(priv->wq); | ||
696 | 691 | ||
697 | return 0; | 692 | return 0; |
698 | } | 693 | } |