aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2016-07-29 00:58:43 -0400
committerDoug Ledford <dledford@redhat.com>2016-08-03 21:03:32 -0400
commit0c87b672098be368dec9a1ab8f1b897e78233ed5 (patch)
tree11bb391f7fa6cd441e939a2ca4bf8754bb631824 /drivers/infiniband/hw/mlx4
parenta154a8cd080b437969ef194dee365bbb60a3b38a (diff)
IB/mlx4: Don't use GFP_ATOMIC for CQ resize struct
We allocate a small tracking structure as part of mlx4_ib_resize_cq(). However, we don't need to use GFP_ATOMIC -- immediately after the allocation, we call mlx4_cq_resize(), which allocates a command mailbox with GFP_KERNEL and then sleeps on a firmware command, so we better not be in an atomic context. This actually has a real impact, because when this GFP_ATOMIC allocation fails (and GFP_ATOMIC does fail in practice) then a userspace consumer resizing a CQ will get a spurious failure that we can easily avoid. Signed-off-by: Roland Dreier <roland@purestorage.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 9f8b516eb2b0..d6fc8a6e8c33 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -288,7 +288,7 @@ static int mlx4_alloc_resize_buf(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq,
288 if (cq->resize_buf) 288 if (cq->resize_buf)
289 return -EBUSY; 289 return -EBUSY;
290 290
291 cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_ATOMIC); 291 cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_KERNEL);
292 if (!cq->resize_buf) 292 if (!cq->resize_buf)
293 return -ENOMEM; 293 return -ENOMEM;
294 294
@@ -316,7 +316,7 @@ static int mlx4_alloc_resize_umem(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq
316 if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) 316 if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd))
317 return -EFAULT; 317 return -EFAULT;
318 318
319 cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_ATOMIC); 319 cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_KERNEL);
320 if (!cq->resize_buf) 320 if (!cq->resize_buf)
321 return -ENOMEM; 321 return -ENOMEM;
322 322