From patchwork Tue Jan 14 15:45:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 3486411 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 645339F381 for ; Tue, 14 Jan 2014 15:46:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA03E20219 for ; Tue, 14 Jan 2014 15:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B999520218 for ; Tue, 14 Jan 2014 15:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751841AbaANPqF (ORCPT ); Tue, 14 Jan 2014 10:46:05 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:52452 "EHLO mail-ea0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbaANPqF (ORCPT ); Tue, 14 Jan 2014 10:46:05 -0500 Received: by mail-ea0-f172.google.com with SMTP id q10so3410392ead.3 for ; Tue, 14 Jan 2014 07:46:04 -0800 (PST) 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=RMCwx4HISpyfYkdXX86xRADM9rjaK4UCUaWB0W13RUQ=; b=mKdfyC9cg5Jb4O/9s//IGmtOJcwjO+ygam3cgJWhv0Hhbu9/PgEffSFk+rFkwBkbTU RejUA79oST11qbdfC4JZpmBdv6MdYxqdk4TEetRWsPdtVLboLKrJzpU19pLKkzC9Jp43 NFSWX+7G2umxefGUjT2kqLhZcvnxwpFrHyds+TlXNrBrzVcvZlQNuePoZvGTx7LfCqmJ jI9p+A77uQGofZGXTpkhqhedpgUq5m+W8ydchgQCMARXZNN+kKTMGahlooaLI6NV++ZR kB+i+tzLzz2yAr2m6zi7XkFkcF2zrWRgxJ6ipLRhJr1YAd7BSZylK4UD4rp3Lo3FGwp7 cyAg== X-Gm-Message-State: ALoCoQkKLNzAhv2Gptc8M0D8LOLz8LXGVNiZXpS1JmK8eTZAkP1U6O3nZje24UpG4L9fb5P21X29 X-Received: by 10.14.212.69 with SMTP id x45mr2929497eeo.69.1389714364037; Tue, 14 Jan 2014 07:46:04 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id m48sm2633111eef.6.2014.01.14.07.46.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 14 Jan 2014 07:46:03 -0800 (PST) From: Eli Cohen To: roland@kernel.org Cc: linux-rdma@vger.kernel.org, davem@davemloft.net, ogerlitz@mellanox.com, Eli Cohen Subject: [PATCH for-next 13/14] IB/mlx5: Abort driver cleanup if teardown hca fails Date: Tue, 14 Jan 2014 17:45:22 +0200 Message-Id: <1389714323-20130-14-git-send-email-eli@mellanox.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1389714323-20130-1-git-send-email-eli@mellanox.com> References: <1389714323-20130-1-git-send-email-eli@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not continue with cleanup flow. If this ever happens we can check which resources remained open. Signed-off-by: Eli Cohen --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 40a9f5e..a064f06 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -460,7 +460,10 @@ disable_msix: err_stop_poll: mlx5_stop_health_poll(dev); - mlx5_cmd_teardown_hca(dev); + if (mlx5_cmd_teardown_hca(dev)) { + dev_err(&dev->pdev->dev, "tear_down_hca failed, skip cleanup\n"); + return err; + } err_pagealloc_stop: mlx5_pagealloc_stop(dev); @@ -503,7 +506,10 @@ void mlx5_dev_cleanup(struct mlx5_core_dev *dev) mlx5_eq_cleanup(dev); mlx5_disable_msix(dev); mlx5_stop_health_poll(dev); - mlx5_cmd_teardown_hca(dev); + if (mlx5_cmd_teardown_hca(dev)) { + dev_err(&dev->pdev->dev, "tear_down_hca failed, skip cleanup\n"); + return; + } mlx5_pagealloc_stop(dev); mlx5_reclaim_startup_pages(dev); mlx5_core_disable_hca(dev);