All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mlx4/ib: Fix WARNING: at lib/swiotlb.c:562
@ 2010-12-14 16:41 Vladimir Sokolovsky
       [not found] ` <4D079E34.5070003-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Sokolovsky @ 2010-12-14 16:41 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma


mlx4_ib_free_cq_buf() should not be called under spin_lock_irq
as dma_free_coherent() needs irqs enabled

Signed-off-by: Vladimir Sokolovsky <vlad-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
  drivers/infiniband/hw/mlx4/cq.c |    9 ++++++++-
  1 files changed, 8 insertions(+), 1 deletions(-)

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;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mlx4/ib: Fix WARNING: at lib/swiotlb.c:562
       [not found] ` <4D079E34.5070003-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2011-01-04 22:31   ` Roland Dreier
  0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2011-01-04 22:31 UTC (permalink / raw)
  To: Vladimir Sokolovsky; +Cc: linux-rdma

Thanks, applied (although your mailer caused some whitespace damage to
the patch that I had to fix by hand)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-04 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-14 16:41 [PATCH] mlx4/ib: Fix WARNING: at lib/swiotlb.c:562 Vladimir Sokolovsky
     [not found] ` <4D079E34.5070003-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-01-04 22:31   ` Roland Dreier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.