Blob Blame History Raw
From: YueHaibing <yuehaibing@huawei.com>
Date: Mon, 4 Mar 2019 10:56:20 +0800
Subject: RDMA/hns: Use GFP_ATOMIC in hns_roce_v2_modify_qp
Patch-mainline: v5.1-rc1
Git-commit: 4e69cf1fe2c52d189acdd06c1fd99cc258aba61f
References: bsc#1104427 FATE#326416

The the below commit, hns_roce_v2_modify_qp is called inside spinlock
while using GFP_KERNEL. Change it to GFP_ATOMIC.

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

--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -3742,7 +3742,7 @@ static int hns_roce_v2_modify_qp(struct
 	struct device *dev = hr_dev->dev;
 	int ret = -EINVAL;
 
-	context = kzalloc(2 * sizeof(*context), GFP_KERNEL);
+	context = kcalloc(2, sizeof(*context), GFP_ATOMIC);
 	if (!context)
 		return -ENOMEM;