Commit 8de8d4fe authored by Kai Ye's avatar Kai Ye Committed by Herbert Xu
Browse files

crypto: hisilicon/qm - fix the uacce mmap failed



Allocate an extra memory page for qp. This extra page is
used to set the device or qp status. But this page not
be used currently. Meanwhile it leads to dus size not equal
to mmap size as using uacce sva mode, and cause the app task
broken.

Signed-off-by: default avatarKai Ye <yekai13@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent cbbb5f07
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3122,8 +3122,10 @@ static int qm_alloc_uacce(struct hisi_qm *qm)
	else
		mmio_page_nr = qm->db_interval / PAGE_SIZE;

	/* Add one more page for device or qp status */
	dus_page_nr = (PAGE_SIZE - 1 + qm->sqe_size * QM_Q_DEPTH +
		       sizeof(struct qm_cqe) * QM_Q_DEPTH) >> PAGE_SHIFT;
		       sizeof(struct qm_cqe) * QM_Q_DEPTH  + PAGE_SIZE) >>
					 PAGE_SHIFT;

	uacce->qf_pg_num[UACCE_QFRT_MMIO] = mmio_page_nr;
	uacce->qf_pg_num[UACCE_QFRT_DUS]  = dus_page_nr;