From patchwork Tue Dec 14 16:41:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sokolovsky X-Patchwork-Id: 410641 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBEGfTht005424 for ; Tue, 14 Dec 2010 16:41:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759513Ab0LNQl3 (ORCPT ); Tue, 14 Dec 2010 11:41:29 -0500 Received: from mail-ew0-f45.google.com ([209.85.215.45]:39336 "EHLO mail-ew0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759510Ab0LNQl2 (ORCPT ); Tue, 14 Dec 2010 11:41:28 -0500 Received: by ewy10 with SMTP id 10so503912ewy.4 for ; Tue, 14 Dec 2010 08:41:27 -0800 (PST) Received: by 10.223.86.194 with SMTP id t2mr5972271fal.40.1292344887459; Tue, 14 Dec 2010 08:41:27 -0800 (PST) Received: from [10.0.2.15] ([82.166.227.17]) by mx.google.com with ESMTPS id n3sm49070faa.29.2010.12.14.08.41.25 (version=SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 08:41:26 -0800 (PST) Message-ID: <4D079E34.5070003@dev.mellanox.co.il> Date: Tue, 14 Dec 2010 18:41:24 +0200 From: Vladimir Sokolovsky User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10 ThunderBrowse/3.3.4 MIME-Version: 1.0 To: Roland Dreier CC: linux-rdma Subject: [PATCH] mlx4/ib: Fix WARNING: at lib/swiotlb.c:562 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Dec 2010 16:41:30 +0000 (UTC) diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c index 5a219a2..e8df155 100644 --- a/drivers/infiniband/hw/mlx4/cq.c +++ b/drivers/infiniband/hw/mlx4/cq.c @@ -397,10 +397,14 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata) cq->resize_buf = NULL; cq->resize_umem = NULL; } else { + struct mlx4_ib_cq_buf tmp_buf; + int tmp_cqe = 0; + spin_lock_irq(&cq->lock); if (cq->resize_buf) { mlx4_ib_cq_resize_copy_cqes(cq); - mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); + tmp_buf = cq->buf; + tmp_cqe = cq->ibcq.cqe; cq->buf = cq->resize_buf->buf; cq->ibcq.cqe = cq->resize_buf->cqe; @@ -408,6 +412,9 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata) cq->resize_buf = NULL; } spin_unlock_irq(&cq->lock); + + if (tmp_cqe) + mlx4_ib_free_cq_buf(dev, &tmp_buf, tmp_cqe); } goto out;