提交 ea99aad6 编写于 作者: K Kai Ye 提交者: Zheng Zengkai

crypto: hisilicon/qm - fix the process of VF's list adding

mainline inclusion
from mainline-master
commit 0dbcf1a2
category: bugfix
bugzilla: 173981
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0dbcf1a24e6875d51c290a174a7f2526498e2836

----------------------------------------------------------------------

If Kunpeng 920 enabled the sva mode, the "qm alg register" process will
return directly. So the list of VF wasn't added to QM list.
Signed-off-by: NKai Ye <yekai13@huawei.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NMingqiang Ling <lingmingqiang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 58fbe1d8
...@@ -4256,17 +4256,17 @@ int hisi_qm_alg_register(struct hisi_qm *qm, struct hisi_qm_list *qm_list) ...@@ -4256,17 +4256,17 @@ int hisi_qm_alg_register(struct hisi_qm *qm, struct hisi_qm_list *qm_list)
int flag = 0; int flag = 0;
int ret = 0; int ret = 0;
if (qm->ver <= QM_HW_V2 && qm->use_sva) {
dev_info(dev, "HW V2 not both use uacce sva mode and hardware crypto algs.\n");
return 0;
}
mutex_lock(&qm_list->lock); mutex_lock(&qm_list->lock);
if (list_empty(&qm_list->list)) if (list_empty(&qm_list->list))
flag = 1; flag = 1;
list_add_tail(&qm->list, &qm_list->list); list_add_tail(&qm->list, &qm_list->list);
mutex_unlock(&qm_list->lock); mutex_unlock(&qm_list->lock);
if (qm->ver <= QM_HW_V2 && qm->use_sva) {
dev_info(dev, "HW V2 not both use uacce sva mode and hardware crypto algs.\n");
return 0;
}
if (flag) { if (flag) {
ret = qm_list->register_to_crypto(qm); ret = qm_list->register_to_crypto(qm);
if (ret) { if (ret) {
...@@ -4291,13 +4291,13 @@ EXPORT_SYMBOL_GPL(hisi_qm_alg_register); ...@@ -4291,13 +4291,13 @@ EXPORT_SYMBOL_GPL(hisi_qm_alg_register);
*/ */
void hisi_qm_alg_unregister(struct hisi_qm *qm, struct hisi_qm_list *qm_list) void hisi_qm_alg_unregister(struct hisi_qm *qm, struct hisi_qm_list *qm_list)
{ {
if (qm->ver <= QM_HW_V2 && qm->use_sva)
return;
mutex_lock(&qm_list->lock); mutex_lock(&qm_list->lock);
list_del(&qm->list); list_del(&qm->list);
mutex_unlock(&qm_list->lock); mutex_unlock(&qm_list->lock);
if (qm->ver <= QM_HW_V2 && qm->use_sva)
return;
if (list_empty(&qm_list->list)) if (list_empty(&qm_list->list))
qm_list->unregister_from_crypto(qm); qm_list->unregister_from_crypto(qm);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册