Commit 6fd50c4f authored by Chengchang Tang's avatar Chengchang Tang Committed by Juan Zhou
Browse files

RDMA/hns: Fix sleeping in setup_dca_buf_to_hw()

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: 12aa71f8 ("RDMA/hns: Add DCA support for kernel space")
Signed-off-by: default avatarChengchang Tang <tangchengchang@huawei.com>
parent 3e7c94b0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
}