diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 0a0851b688fc303c5fe8b674498dab0d6e4dee68..d2783c2690962463c8e88195cca0f7f8a88b8c6a 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -2339,10 +2339,10 @@ int hisi_qm_start(struct hisi_qm *qm) if (!qm->qp_bitmap) { 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, sizeof(struct hisi_qp *), - GFP_KERNEL); + GFP_ATOMIC); if (!qm->qp_bitmap || !qm->qp_array) { ret = -ENOMEM; goto err_unlock; @@ -2364,7 +2364,7 @@ int hisi_qm_start(struct hisi_qm *qm) QMC_ALIGN(sizeof(struct qm_cqc) * qm->qp_num); qm->qdma.va = dma_alloc_coherent(dev, qm->qdma.size, &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", qm->qdma.va, &qm->qdma.dma, qm->qdma.size); if (!qm->qdma.va) { diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index 36792cf20d213a23e8ad4bac248eb75818f351ea..d7b9e6af03598c882a8a7e21358932652bcea95d 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c @@ -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); qp_ctx->req_bitmap = kcalloc(BITS_TO_LONGS(QM_Q_DEPTH), sizeof(long), - GFP_KERNEL); + GFP_ATOMIC); if (!qp_ctx->req_bitmap) { ret = -ENOMEM; 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) { ret = -ENOMEM; goto err_free_req_bitmap;