Commit fe3c5206 authored by Herbert Xu's avatar Herbert Xu

[CRYPTO] api: Wake up all waiters when larval completes

Right now when a larval matures or when it dies of an error we
only wake up one waiter.  This would cause other waiters to timeout
unnecessarily.  This patch changes it to use complete_all to wake
up all waiters.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2e290f43
...@@ -34,7 +34,7 @@ void crypto_larval_error(const char *name, u32 type, u32 mask) ...@@ -34,7 +34,7 @@ void crypto_larval_error(const char *name, u32 type, u32 mask)
if (alg) { if (alg) {
if (crypto_is_larval(alg)) { if (crypto_is_larval(alg)) {
struct crypto_larval *larval = (void *)alg; struct crypto_larval *larval = (void *)alg;
complete(&larval->completion); complete_all(&larval->completion);
} }
crypto_mod_put(alg); crypto_mod_put(alg);
} }
...@@ -164,7 +164,7 @@ static int __crypto_register_alg(struct crypto_alg *alg, ...@@ -164,7 +164,7 @@ static int __crypto_register_alg(struct crypto_alg *alg,
continue; continue;
larval->adult = alg; larval->adult = alg;
complete(&larval->completion); complete_all(&larval->completion);
continue; continue;
} }
......
...@@ -144,7 +144,7 @@ static void crypto_larval_kill(struct crypto_alg *alg) ...@@ -144,7 +144,7 @@ static void crypto_larval_kill(struct crypto_alg *alg)
down_write(&crypto_alg_sem); down_write(&crypto_alg_sem);
list_del(&alg->cra_list); list_del(&alg->cra_list);
up_write(&crypto_alg_sem); up_write(&crypto_alg_sem);
complete(&larval->completion); complete_all(&larval->completion);
crypto_alg_put(alg); crypto_alg_put(alg);
} }
......
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