From patchwork Thu Oct 31 13:26:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 3120501 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4521CBF924 for ; Thu, 31 Oct 2013 13:27:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3343A20461 for ; Thu, 31 Oct 2013 13:27:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5B072045A for ; Thu, 31 Oct 2013 13:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754258Ab3JaN07 (ORCPT ); Thu, 31 Oct 2013 09:26:59 -0400 Received: from mail-ea0-f182.google.com ([209.85.215.182]:53099 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753203Ab3JaN06 (ORCPT ); Thu, 31 Oct 2013 09:26:58 -0400 Received: by mail-ea0-f182.google.com with SMTP id o10so1407411eaj.27 for ; Thu, 31 Oct 2013 06:26:57 -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=1ocGQUbXVKv/T8xXhKR+evreYycC4R33jF822ZXFHHA=; b=HfLohx+3dYt99kTFpv3E8O6Zlh2eoQCjhF2OnzhhvxKy4oDkvSb9JBXsgMkeXXq0HZ hEe4ADvgJpyzBu8DUnmuyDqIMT7oMjnhv0Mp2SA7pqWN8udQFEFk1KoRFO/Bu9uU5ri+ RcOgmhUdceqbqDjumFkr5O9SWspjVApuYUlkFUJG0bFczIugEjO0+xync74SGYd2uK2t Fv0rV3f5Y6b22cNefGFW3KzwIGC0RFpE77ZoAXrMIh/MsgDqqENGsklLC6h/9Yc3UqRL ut3arQkvIW/v9jbyXIGToOIjdEAtOiPZ3wlYkPa2iEj+yWNMOSqZ3ik4BPb4lyug7ODs aJzQ== X-Gm-Message-State: ALoCoQkE5EIV4/GJKJL2tYRBjmdIA3p5YtyhECfAyKZdbw4qs2eR/LfA48Fs0OK9r7FUCtbxhyxg X-Received: by 10.14.174.131 with SMTP id x3mr3228985eel.25.1383226017537; Thu, 31 Oct 2013 06:26:57 -0700 (PDT) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id b42sm8569135eem.9.2013.10.31.06.26.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 31 Oct 2013 06:26:57 -0700 (PDT) From: Eli Cohen To: roland@kernel.org Cc: linux-rdma@vger.kernel.org, amirv@mellanox.com, ogerlitz@mellanox.com, yevgenyp@mellanox.com, Eli Cohen Subject: [PATCH for-next 3/6] IB/mlx5: Fix list_del of empty list Date: Thu, 31 Oct 2013 15:26:33 +0200 Message-Id: <1383225996-14828-4-git-send-email-eli@mellanox.com> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1383225996-14828-1-git-send-email-eli@mellanox.com> References: <1383225996-14828-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.4 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 For archs with pages size of 4K, when the chunk is freed, fwp is not in the list so avoid attempting to delete it. Signed-off-by: Eli Cohen --- drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index ba816c2..37b6ad1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c @@ -229,7 +229,8 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr) set_bit(n, &fwp->bitmask); if (fwp->free_count == MLX5_NUM_4K_IN_PAGE) { rb_erase(&fwp->rb_node, &dev->priv.page_root); - list_del(&fwp->list); + if (fwp->free_count != 1) + list_del(&fwp->list); dma_unmap_page(&dev->pdev->dev, addr, PAGE_SIZE, DMA_BIDIRECTIONAL); __free_page(fwp->page); kfree(fwp);