You need to sign in or sign up before continuing.
提交 733c2fd1 编写于 作者: T tanghui20 提交者: Xie XiuQi

ACC: apply for memory using "GFP_KERNEL"in the lock

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Using GFP_KERNEL when applying for memory may sleep,
if this action may trigger a deadlock in the lock

Feature or Bugfix:Bugfix
Signed-off-by: Ntanghui20 <tanghui20@huawei.com>
Reviewed-by: Nxuzaibo <xuzaibo@huawei.com>
Signed-off-by: Nlingmingqiang <lingmingqiang@huawei.com>
Reviewed-by: Nlingmingqiang <lingmingqiang@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0068a2ec
...@@ -2339,10 +2339,10 @@ int hisi_qm_start(struct hisi_qm *qm) ...@@ -2339,10 +2339,10 @@ int hisi_qm_start(struct hisi_qm *qm)
if (!qm->qp_bitmap) { if (!qm->qp_bitmap) {
qm->qp_bitmap = devm_kcalloc(dev, BITS_TO_LONGS(qm->qp_num), qm->qp_bitmap = devm_kcalloc(dev, BITS_TO_LONGS(qm->qp_num),
sizeof(long), GFP_KERNEL); sizeof(long), GFP_ATOMIC);
qm->qp_array = devm_kcalloc(dev, qm->qp_num, qm->qp_array = devm_kcalloc(dev, qm->qp_num,
sizeof(struct hisi_qp *), sizeof(struct hisi_qp *),
GFP_KERNEL); GFP_ATOMIC);
if (!qm->qp_bitmap || !qm->qp_array) { if (!qm->qp_bitmap || !qm->qp_array) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_unlock; goto err_unlock;
...@@ -2364,7 +2364,7 @@ int hisi_qm_start(struct hisi_qm *qm) ...@@ -2364,7 +2364,7 @@ int hisi_qm_start(struct hisi_qm *qm)
QMC_ALIGN(sizeof(struct qm_cqc) * qm->qp_num); QMC_ALIGN(sizeof(struct qm_cqc) * qm->qp_num);
qm->qdma.va = dma_alloc_coherent(dev, qm->qdma.size, qm->qdma.va = dma_alloc_coherent(dev, qm->qdma.size,
&qm->qdma.dma, &qm->qdma.dma,
GFP_KERNEL | __GFP_ZERO); GFP_ATOMIC | __GFP_ZERO);
dev_dbg(dev, "allocate qm dma buf(va=%pK, dma=%pad, size=%lx)\n", dev_dbg(dev, "allocate qm dma buf(va=%pK, dma=%pad, size=%lx)\n",
qm->qdma.va, &qm->qdma.dma, qm->qdma.size); qm->qdma.va, &qm->qdma.dma, qm->qdma.size);
if (!qm->qdma.va) { if (!qm->qdma.va) {
......
...@@ -200,13 +200,13 @@ static int hisi_sec_create_qp_ctx(struct hisi_qm *qm, struct hisi_sec_ctx *ctx, ...@@ -200,13 +200,13 @@ static int hisi_sec_create_qp_ctx(struct hisi_qm *qm, struct hisi_sec_ctx *ctx,
atomic_set(&qp_ctx->req_cnt, 0); atomic_set(&qp_ctx->req_cnt, 0);
qp_ctx->req_bitmap = kcalloc(BITS_TO_LONGS(QM_Q_DEPTH), sizeof(long), qp_ctx->req_bitmap = kcalloc(BITS_TO_LONGS(QM_Q_DEPTH), sizeof(long),
GFP_KERNEL); GFP_ATOMIC);
if (!qp_ctx->req_bitmap) { if (!qp_ctx->req_bitmap) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_qm_release_qp; goto err_qm_release_qp;
} }
qp_ctx->req_list = kcalloc(QM_Q_DEPTH, sizeof(void *), GFP_KERNEL); qp_ctx->req_list = kcalloc(QM_Q_DEPTH, sizeof(void *), GFP_ATOMIC);
if (!qp_ctx->req_list) { if (!qp_ctx->req_list) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_free_req_bitmap; goto err_free_req_bitmap;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册