Skip to contentSkip to conversation

mlx4/ib: Fix WARNING: at lib/swiotlb.c:562

PATCH In review Vladimir Sokolovsky 2 participants 2 messages Dec 14, 2010 – Jan 4, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlx4/ib: Fix WARNING: at lib/swiotlb.c:562

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

---
 drivers/infiniband/hw/mlx4/cq.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/infiniband/hw/mlx4/cq.c +8 -1
index 5a219a2..e8df155 100644
@@ -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;
Signature · 6 lines
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4D079E34.5070003-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org