Backport uadk engine patch(24-32) from linaro. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> (cherry picked from commit 9a48324e3f545ee8f8485847f3fecf252682eb6a)
43 lines
1.1 KiB
Diff
43 lines
1.1 KiB
Diff
From 8ce0ba841358d85eb89bf726d229dfaf4cd13156 Mon Sep 17 00:00:00 2001
|
|
From: Weili Qian <qianweili@huawei.com>
|
|
Date: Thu, 3 Mar 2022 02:59:13 +0000
|
|
Subject: [PATCH 28/31] ecc: fix checking conditions
|
|
|
|
When initializing, the process is guaranteed
|
|
not to be initialized repeatedly. And when
|
|
uninitializing, the resource is released according
|
|
to whether the pid is equal or not.
|
|
|
|
Signed-off-by: Weili Qian <qianweili@huawei.com>
|
|
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
|
|
---
|
|
src/uadk_pkey.c | 5 +----
|
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
|
|
|
diff --git a/src/uadk_pkey.c b/src/uadk_pkey.c
|
|
index 14e0b8f..ceb7a8f 100644
|
|
--- a/src/uadk_pkey.c
|
|
+++ b/src/uadk_pkey.c
|
|
@@ -184,9 +184,6 @@ static int uadk_e_wd_ecc_general_init(struct uacce_dev *dev,
|
|
struct wd_ctx_config *ctx_cfg;
|
|
int ret, i;
|
|
|
|
- if (ecc_res.ctx_res)
|
|
- return 0;
|
|
-
|
|
ctx_cfg = calloc(1, sizeof(struct wd_ctx_config));
|
|
if (!ctx_cfg)
|
|
return -ENOMEM;
|
|
@@ -256,7 +253,7 @@ static void uadk_wd_ecc_uninit(void)
|
|
struct wd_ctx_config *ctx_cfg = ecc_res.ctx_res;
|
|
int i, ret;
|
|
|
|
- if (!ctx_cfg)
|
|
+ if (ecc_res.pid != getpid())
|
|
return;
|
|
|
|
ret = uadk_e_is_env_enabled("ecc");
|
|
--
|
|
2.24.4
|
|
|