Skip to content

Commit b74fd80

Browse files
Chenghai Huangherbertx
authored andcommitted
crypto: hisilicon/qm - fix incorrect judgment in qm_get_complete_eqe_num()
In qm_get_complete_eqe_num(), the function entry has already checked whether the interrupt is valid, so the interrupt event can be processed directly. Currently, the interrupt valid bit is being checked again redundantly, and no interrupt processing is performed. Therefore, the loop condition should be modified to directly process the interrupt event, and use do while instead of the current while loop, because the condition is always satisfied on the first iteration. Fixes: f5a3329 ("crypto: hisilicon/qm - add the save operation of eqe and aeqe") Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 50fdb78 commit b74fd80

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • drivers/crypto/hisilicon

drivers/crypto/hisilicon/qm.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ static void qm_get_complete_eqe_num(struct hisi_qm *qm)
991991
return;
992992
poll_data = &qm->poll_data[cqn];
993993

994-
while (QM_EQE_PHASE(dw0) != qm->status.eqc_phase) {
994+
do {
995995
poll_data->qp_finish_id[eqe_num] = dw0 & QM_EQE_CQN_MASK;
996996
eqe_num++;
997997

@@ -1004,11 +1004,10 @@ static void qm_get_complete_eqe_num(struct hisi_qm *qm)
10041004
qm->status.eq_head++;
10051005
}
10061006

1007-
if (eqe_num == (eq_depth >> 1) - 1)
1008-
break;
1009-
10101007
dw0 = le32_to_cpu(eqe->dw0);
1011-
}
1008+
if (QM_EQE_PHASE(dw0) != qm->status.eqc_phase)
1009+
break;
1010+
} while (eqe_num < (eq_depth >> 1) - 1);
10121011

10131012
poll_data->eqe_num = eqe_num;
10141013
queue_work(qm->wq, &poll_data->work);

0 commit comments

Comments
 (0)