From: Eli Cohen Date: Thu, 23 Oct 2014 12:57:27 +0000 (+0300) Subject: net/mlx4_core: Call synchronize_irq() before freeing EQ buffer X-Git-Tag: v3.18-rc3~17^2~36^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf1bac5b7882daa41249f85fbc97828f0597de5c;p=platform%2Fkernel%2Flinux-exynos.git net/mlx4_core: Call synchronize_irq() before freeing EQ buffer After moving the EQ ownership to software effectively destroying it, call synchronize_irq() to ensure that any handler routines running on other CPU cores finish execution. Only then free the EQ buffer. The same thing is done when we destroy a CQ which is one of the sources generating interrupts. In the case of CQ we want to avoid completion handlers on a CQ that was destroyed. In the case we do the same to avoid receiving asynchronous events after the EQ has been destroyed and its buffers freed. Signed-off-by: Eli Cohen Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index a49c9d1..49290a4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c @@ -1026,6 +1026,7 @@ static void mlx4_free_eq(struct mlx4_dev *dev, pr_cont("\n"); } } + synchronize_irq(eq->irq); mlx4_mtt_cleanup(dev, &eq->mtt); for (i = 0; i < npages; ++i)