Netdev List
 help / color / mirror / Atom feed
From: Eli Cohen <eli@dev.mellanox.co.il>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ogerlitz@mellanox.com,
	Eli Cohen <eli@mellanox.com>
Subject: [PATCH for-net 2/2] net/mlx4_core: Call synchronize_irq() before freeing EQ buffer
Date: Thu, 23 Oct 2014 15:57:27 +0300	[thread overview]
Message-ID: <1414069047-30865-3-git-send-email-eli@mellanox.com> (raw)
In-Reply-To: <1414069047-30865-1-git-send-email-eli@mellanox.com>

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 <eli@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/eq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
index a49c9d11d8a5..49290a405903 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)
-- 
2.1.2

      parent reply	other threads:[~2014-10-23 12:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 12:57 [PATCH for-net 0/2] irq sync fixes Eli Cohen
2014-10-23 12:57 ` [PATCH for-net 1/2] net/mlx5_core: Call synchronize_irq() before freeing EQ buffer Eli Cohen
2014-10-23 12:57 ` Eli Cohen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414069047-30865-3-git-send-email-eli@mellanox.com \
    --to=eli@dev.mellanox.co.il \
    --cc=davem@davemloft.net \
    --cc=eli@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox