[ofa-general] [PATCH] IB/mlx4 mlx4_ib: fix doorbell allocations

Eli Cohen eli at mellanox.co.il
Sun May 6 08:53:19 PDT 2007


These allocations are done under a spinlock and should be made with
GFP_ATOMIC flags to prevent a deadlock.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>

---

Index: connectx_kernel/drivers/infiniband/hw/mlx4/doorbell.c
===================================================================
--- connectx_kernel.orig/drivers/infiniband/hw/mlx4/doorbell.c	2007-05-06 10:38:26.000000000 +0300
+++ connectx_kernel/drivers/infiniband/hw/mlx4/doorbell.c	2007-05-06 10:43:08.000000000 +0300
@@ -47,7 +47,7 @@ static struct mlx4_ib_db_pgdir *mlx4_ib_
 {
 	struct mlx4_ib_db_pgdir *pgdir;
 
-	pgdir = kzalloc(sizeof *pgdir, GFP_KERNEL);
+	pgdir = kzalloc(sizeof *pgdir, GFP_ATOMIC);
 	if (!pgdir)
 		return NULL;
 
@@ -56,7 +56,7 @@ static struct mlx4_ib_db_pgdir *mlx4_ib_
 	pgdir->bits[1] = pgdir->order1;
 	pgdir->db_page = dma_alloc_coherent(dev->ib_dev.dma_device,
 					    PAGE_SIZE, &pgdir->db_dma,
-					    GFP_KERNEL);
+					    GFP_ATOMIC);
 	if (!pgdir->db_page) {
 		kfree(pgdir);
 		return NULL;




More information about the general mailing list