Skip to content

Commit b977e03

Browse files
tsk-lieacuiherbertx
authored andcommitted
crypto: hisilicon - remove use_dma_api related codes
The codes related use_dma_api is useless which should be removed. Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 7ce396f commit b977e03

File tree

5 files changed

+13
-25
lines changed

5 files changed

+13
-25
lines changed

drivers/crypto/hisilicon/hpre/hpre_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,6 @@ static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
679679
qm->qp_base = HPRE_PF_DEF_Q_BASE;
680680
qm->qp_num = pf_q_num;
681681
}
682-
qm->use_dma_api = true;
683682

684683
return hisi_qm_init(qm);
685684
}

drivers/crypto/hisilicon/qm.c

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,20 +1267,18 @@ static struct hisi_qp *qm_create_qp_nolock(struct hisi_qm *qm, u8 alg_type)
12671267
qm->qp_in_used++;
12681268
qp->qm = qm;
12691269

1270-
if (qm->use_dma_api) {
1271-
qp->qdma.size = qm->sqe_size * QM_Q_DEPTH +
1272-
sizeof(struct qm_cqe) * QM_Q_DEPTH;
1273-
qp->qdma.va = dma_alloc_coherent(dev, qp->qdma.size,
1274-
&qp->qdma.dma, GFP_KERNEL);
1275-
if (!qp->qdma.va) {
1276-
ret = -ENOMEM;
1277-
goto err_clear_bit;
1278-
}
1279-
1280-
dev_dbg(dev, "allocate qp dma buf(va=%pK, dma=%pad, size=%zx)\n",
1281-
qp->qdma.va, &qp->qdma.dma, qp->qdma.size);
1270+
qp->qdma.size = qm->sqe_size * QM_Q_DEPTH +
1271+
sizeof(struct qm_cqe) * QM_Q_DEPTH;
1272+
qp->qdma.va = dma_alloc_coherent(dev, qp->qdma.size,
1273+
&qp->qdma.dma, GFP_KERNEL);
1274+
if (!qp->qdma.va) {
1275+
ret = -ENOMEM;
1276+
goto err_clear_bit;
12821277
}
12831278

1279+
dev_dbg(dev, "allocate qp dma buf(va=%pK, dma=%pad, size=%zx)\n",
1280+
qp->qdma.va, &qp->qdma.dma, qp->qdma.size);
1281+
12841282
qp->qp_id = qp_id;
12851283
qp->alg_type = alg_type;
12861284
atomic_set(&qp->qp_status.flags, QP_INIT);
@@ -1334,7 +1332,7 @@ void hisi_qm_release_qp(struct hisi_qp *qp)
13341332
return;
13351333
}
13361334

1337-
if (qm->use_dma_api && qdma->va)
1335+
if (qdma->va)
13381336
dma_free_coherent(dev, qdma->size, qdma->va, qdma->dma);
13391337

13401338
qm->qp_array[qp->qp_id] = NULL;
@@ -1992,8 +1990,6 @@ int hisi_qm_init(struct hisi_qm *qm)
19921990
INIT_WORK(&qm->work, qm_work_process);
19931991

19941992
atomic_set(&qm->status.flags, QM_INIT);
1995-
dev_dbg(dev, "init qm %s with %s\n", pdev->is_physfn ? "pf" : "vf",
1996-
qm->use_dma_api ? "dma api" : "iommu api");
19971993

19981994
return 0;
19991995

@@ -2034,7 +2030,7 @@ void hisi_qm_uninit(struct hisi_qm *qm)
20342030
uacce_remove(qm->uacce);
20352031
qm->uacce = NULL;
20362032

2037-
if (qm->use_dma_api && qm->qdma.va) {
2033+
if (qm->qdma.va) {
20382034
hisi_qm_cache_wb(qm);
20392035
dma_free_coherent(dev, qm->qdma.size,
20402036
qm->qdma.va, qm->qdma.dma);
@@ -2259,11 +2255,7 @@ int hisi_qm_start(struct hisi_qm *qm)
22592255
}
22602256
}
22612257

2262-
if (!qm->use_dma_api) {
2263-
dev_dbg(&qm->pdev->dev, "qm delay start\n");
2264-
up_write(&qm->qps_lock);
2265-
return 0;
2266-
} else if (!qm->qdma.va) {
2258+
if (!qm->qdma.va) {
22672259
qm->qdma.size = QMC_ALIGN(sizeof(struct qm_eqe) * QM_Q_DEPTH) +
22682260
QMC_ALIGN(sizeof(struct qm_aeqe) * QM_Q_DEPTH) +
22692261
QMC_ALIGN(sizeof(struct qm_sqc) * qm->qp_num) +

drivers/crypto/hisilicon/qm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ struct hisi_qm {
230230
struct work_struct work;
231231

232232
const char *algs;
233-
bool use_dma_api;
234233
bool use_sva;
235234
resource_size_t phys_base;
236235
resource_size_t phys_size;

drivers/crypto/hisilicon/sec2/sec_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,6 @@ static int sec_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
749749
qm->qp_base = SEC_PF_DEF_Q_NUM;
750750
qm->qp_num = SEC_QUEUE_NUM_V1 - SEC_PF_DEF_Q_NUM;
751751
}
752-
qm->use_dma_api = true;
753752

754753
return hisi_qm_init(qm);
755754
}

drivers/crypto/hisilicon/zip/zip_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
692692
if (rev_id == QM_HW_UNKNOWN)
693693
return -EINVAL;
694694

695-
qm->use_dma_api = true;
696695
qm->pdev = pdev;
697696
qm->ver = rev_id;
698697

0 commit comments

Comments
 (0)