Commit b977e030 authored by Shukun Tan's avatar Shukun Tan Committed by Herbert Xu

crypto: hisilicon - remove use_dma_api related codes

The codes related use_dma_api is useless which should be removed.
Signed-off-by: default avatarShukun Tan <tanshukun1@huawei.com>
Reviewed-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 7ce396fa
...@@ -679,7 +679,6 @@ static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev) ...@@ -679,7 +679,6 @@ static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
qm->qp_base = HPRE_PF_DEF_Q_BASE; qm->qp_base = HPRE_PF_DEF_Q_BASE;
qm->qp_num = pf_q_num; qm->qp_num = pf_q_num;
} }
qm->use_dma_api = true;
return hisi_qm_init(qm); return hisi_qm_init(qm);
} }
......
...@@ -1267,20 +1267,18 @@ static struct hisi_qp *qm_create_qp_nolock(struct hisi_qm *qm, u8 alg_type) ...@@ -1267,20 +1267,18 @@ static struct hisi_qp *qm_create_qp_nolock(struct hisi_qm *qm, u8 alg_type)
qm->qp_in_used++; qm->qp_in_used++;
qp->qm = qm; qp->qm = qm;
if (qm->use_dma_api) { qp->qdma.size = qm->sqe_size * QM_Q_DEPTH +
qp->qdma.size = qm->sqe_size * QM_Q_DEPTH + sizeof(struct qm_cqe) * QM_Q_DEPTH;
sizeof(struct qm_cqe) * QM_Q_DEPTH; qp->qdma.va = dma_alloc_coherent(dev, qp->qdma.size,
qp->qdma.va = dma_alloc_coherent(dev, qp->qdma.size, &qp->qdma.dma, GFP_KERNEL);
&qp->qdma.dma, GFP_KERNEL); if (!qp->qdma.va) {
if (!qp->qdma.va) { ret = -ENOMEM;
ret = -ENOMEM; goto err_clear_bit;
goto err_clear_bit;
}
dev_dbg(dev, "allocate qp dma buf(va=%pK, dma=%pad, size=%zx)\n",
qp->qdma.va, &qp->qdma.dma, qp->qdma.size);
} }
dev_dbg(dev, "allocate qp dma buf(va=%pK, dma=%pad, size=%zx)\n",
qp->qdma.va, &qp->qdma.dma, qp->qdma.size);
qp->qp_id = qp_id; qp->qp_id = qp_id;
qp->alg_type = alg_type; qp->alg_type = alg_type;
atomic_set(&qp->qp_status.flags, QP_INIT); atomic_set(&qp->qp_status.flags, QP_INIT);
...@@ -1334,7 +1332,7 @@ void hisi_qm_release_qp(struct hisi_qp *qp) ...@@ -1334,7 +1332,7 @@ void hisi_qm_release_qp(struct hisi_qp *qp)
return; return;
} }
if (qm->use_dma_api && qdma->va) if (qdma->va)
dma_free_coherent(dev, qdma->size, qdma->va, qdma->dma); dma_free_coherent(dev, qdma->size, qdma->va, qdma->dma);
qm->qp_array[qp->qp_id] = NULL; qm->qp_array[qp->qp_id] = NULL;
...@@ -1992,8 +1990,6 @@ int hisi_qm_init(struct hisi_qm *qm) ...@@ -1992,8 +1990,6 @@ int hisi_qm_init(struct hisi_qm *qm)
INIT_WORK(&qm->work, qm_work_process); INIT_WORK(&qm->work, qm_work_process);
atomic_set(&qm->status.flags, QM_INIT); atomic_set(&qm->status.flags, QM_INIT);
dev_dbg(dev, "init qm %s with %s\n", pdev->is_physfn ? "pf" : "vf",
qm->use_dma_api ? "dma api" : "iommu api");
return 0; return 0;
...@@ -2034,7 +2030,7 @@ void hisi_qm_uninit(struct hisi_qm *qm) ...@@ -2034,7 +2030,7 @@ void hisi_qm_uninit(struct hisi_qm *qm)
uacce_remove(qm->uacce); uacce_remove(qm->uacce);
qm->uacce = NULL; qm->uacce = NULL;
if (qm->use_dma_api && qm->qdma.va) { if (qm->qdma.va) {
hisi_qm_cache_wb(qm); hisi_qm_cache_wb(qm);
dma_free_coherent(dev, qm->qdma.size, dma_free_coherent(dev, qm->qdma.size,
qm->qdma.va, qm->qdma.dma); qm->qdma.va, qm->qdma.dma);
...@@ -2259,11 +2255,7 @@ int hisi_qm_start(struct hisi_qm *qm) ...@@ -2259,11 +2255,7 @@ int hisi_qm_start(struct hisi_qm *qm)
} }
} }
if (!qm->use_dma_api) { if (!qm->qdma.va) {
dev_dbg(&qm->pdev->dev, "qm delay start\n");
up_write(&qm->qps_lock);
return 0;
} else if (!qm->qdma.va) {
qm->qdma.size = QMC_ALIGN(sizeof(struct qm_eqe) * QM_Q_DEPTH) + qm->qdma.size = QMC_ALIGN(sizeof(struct qm_eqe) * QM_Q_DEPTH) +
QMC_ALIGN(sizeof(struct qm_aeqe) * QM_Q_DEPTH) + QMC_ALIGN(sizeof(struct qm_aeqe) * QM_Q_DEPTH) +
QMC_ALIGN(sizeof(struct qm_sqc) * qm->qp_num) + QMC_ALIGN(sizeof(struct qm_sqc) * qm->qp_num) +
......
...@@ -230,7 +230,6 @@ struct hisi_qm { ...@@ -230,7 +230,6 @@ struct hisi_qm {
struct work_struct work; struct work_struct work;
const char *algs; const char *algs;
bool use_dma_api;
bool use_sva; bool use_sva;
resource_size_t phys_base; resource_size_t phys_base;
resource_size_t phys_size; resource_size_t phys_size;
......
...@@ -749,7 +749,6 @@ static int sec_qm_init(struct hisi_qm *qm, struct pci_dev *pdev) ...@@ -749,7 +749,6 @@ static int sec_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
qm->qp_base = SEC_PF_DEF_Q_NUM; qm->qp_base = SEC_PF_DEF_Q_NUM;
qm->qp_num = SEC_QUEUE_NUM_V1 - SEC_PF_DEF_Q_NUM; qm->qp_num = SEC_QUEUE_NUM_V1 - SEC_PF_DEF_Q_NUM;
} }
qm->use_dma_api = true;
return hisi_qm_init(qm); return hisi_qm_init(qm);
} }
......
...@@ -692,7 +692,6 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev) ...@@ -692,7 +692,6 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
if (rev_id == QM_HW_UNKNOWN) if (rev_id == QM_HW_UNKNOWN)
return -EINVAL; return -EINVAL;
qm->use_dma_api = true;
qm->pdev = pdev; qm->pdev = pdev;
qm->ver = rev_id; qm->ver = rev_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment