From patchwork Thu Oct 23 12:57:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 402470 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 73C45140095 for ; Thu, 23 Oct 2014 23:57:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755774AbaJWM5n (ORCPT ); Thu, 23 Oct 2014 08:57:43 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:39911 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755762AbaJWM5k (ORCPT ); Thu, 23 Oct 2014 08:57:40 -0400 Received: by mail-wg0-f43.google.com with SMTP id m15so1020115wgh.26 for ; Thu, 23 Oct 2014 05:57:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8//fSxxgB6WcQyBbd97JUckqQJikn8JFRYjp+JalZd0=; b=c7qmGq2sf5dTiDOvkrSe1RNzQyl+02lfr9a2xBeu0qyk+eDWvE57CcByJiBbey01qa jki5bCfjmRXr2g0tu7bDBvmMjLXX/cNsxWQ1nlB2BgxL5XjHojmyQXHK3lQS3svC6bI8 ibOiTCkRHDlE5SVue+96msv4OaInnx0OlWNTwE9inKcNndiz0rMfynMh85sCEfYwjzxL RnG821k750aHM6oelUCOZpxey5i8/NRDsnLseaMX78BST87RMO6CHlHOSh33wCNGyZD0 xWOastOaVHFgt1Sl3d6jxlQVirWHetsR+mMJe2JsCCNLkAnMFD6GZ/hCIZjawWtfPEfw AfOA== X-Gm-Message-State: ALoCoQnnTOuXxq2N6tDKzweADUm5Hgug5/aNcB0bXCWHQ6ES1RoaIweCFowRCUI621a30NlKaV6h X-Received: by 10.194.81.6 with SMTP id v6mr5166924wjx.39.1414069058636; Thu, 23 Oct 2014 05:57:38 -0700 (PDT) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id wx3sm2088245wjc.19.2014.10.23.05.57.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 23 Oct 2014 05:57:35 -0700 (PDT) From: Eli Cohen X-Google-Original-From: Eli Cohen To: davem@davemloft.net Cc: netdev@vger.kernel.org, ogerlitz@mellanox.com, Eli Cohen 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 Message-Id: <1414069047-30865-3-git-send-email-eli@mellanox.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1414069047-30865-1-git-send-email-eli@mellanox.com> References: <1414069047-30865-1-git-send-email-eli@mellanox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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)