diff mbox series

[-next] RDMA/hns: Use GFP_ATOMIC in hns_roce_v2_modify_qp

Message ID 20190304025620.27224-1-yuehaibing@huawei.com (mailing list archive)
State Mainlined
Commit 4e69cf1fe2c52d189acdd06c1fd99cc258aba61f
Delegated to: Jason Gunthorpe
Headers show
Series [-next] RDMA/hns: Use GFP_ATOMIC in hns_roce_v2_modify_qp | expand

Commit Message

Yue Haibing March 4, 2019, 2:56 a.m. UTC
From: YueHaibing <yuehaibing@huawei.com>

In commit 0425e3e6e0c7, hns_roce_v2_modify_qp called inside
spinlock which using GFP_KERNEL, it may sleep with holding
the spinlock, so we should use GFP_ATOMIC instead.

Fixes: 0425e3e6e0c7 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Gunthorpe March 4, 2019, 8:25 p.m. UTC | #1
On Mon, Mar 04, 2019 at 10:56:20AM +0800, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> 
> In commit 0425e3e6e0c7, hns_roce_v2_modify_qp called inside
> spinlock which using GFP_KERNEL, it may sleep with holding
> the spinlock, so we should use GFP_ATOMIC instead.
> 
> Fixes: 0425e3e6e0c7 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 8795266..1c54390 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -4027,7 +4027,7 @@  static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
 	struct device *dev = hr_dev->dev;
 	int ret = -EINVAL;
 
-	context = kcalloc(2, sizeof(*context), GFP_KERNEL);
+	context = kcalloc(2, sizeof(*context), GFP_ATOMIC);
 	if (!context)
 		return -ENOMEM;