OSDN Git Service

RDMA/hns: Use GFP_ATOMIC in hns_roce_v2_modify_qp
authorYueHaibing <yuehaibing@huawei.com>
Mon, 4 Mar 2019 02:56:20 +0000 (10:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:23 +0000 (09:21 +0100)
[ Upstream commit 4e69cf1fe2c52d189acdd06c1fd99cc258aba61f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c

index a5ec900..7021444 100644 (file)
@@ -3446,7 +3446,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;