driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6GT7F
--------------------------------------------------------------------------
setup_dca_buf_to_hw() was in a spinlock which is a kind of atomic context.
Replace the kvcalloc() with no sleep kcalloc()
Fixes: 12aa71f83089 ("RDMA/hns: Add DCA support for kernel space") Signed-off-by: Chengchang Tang tangchengchang@huawei.com --- drivers/infiniband/hw/hns/hns_roce_dca.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_dca.c b/drivers/infiniband/hw/hns/hns_roce_dca.c index ef4eda064724..b49a78528ef3 100644 --- a/drivers/infiniband/hw/hns/hns_roce_dca.c +++ b/drivers/infiniband/hw/hns/hns_roce_dca.c @@ -346,7 +346,7 @@ static int setup_dca_buf_to_hw(struct hns_roce_dev *hr_dev, int ret;
/* alloc a tmp array to store buffer's dma address */ - pages = kvcalloc(count, sizeof(dma_addr_t), GFP_ATOMIC); + pages = kcalloc(count, sizeof(dma_addr_t), GFP_ATOMIC); if (!pages) return -ENOMEM;
@@ -369,7 +369,7 @@ static int setup_dca_buf_to_hw(struct hns_roce_dev *hr_dev, ret = config_dca_qpc(hr_dev, hr_qp, pages, count); err_get_pages: /* drop tmp array */ - kvfree(pages); + kfree(pages);
return ret; }