linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Mathew <john.mathew@unikie.com>
To: linux-rt-users@vger.kernel.org
Cc: lukas.bulwahn@gmail.com, John Mathew <john.mathew@unikie.com>
Subject: [PATCH] Remove redundant wait for completion
Date: Fri, 13 Dec 2019 11:18:43 +0200	[thread overview]
Message-ID: <20191213091843.8365-1-john.mathew@unikie.com> (raw)
In-Reply-To: <CAJz2qXnPquUZSeO9SWSmvLKcdhnT96KnD66F-oatdnotYkxS+A () mail ! gmail ! com>

Wait and completion was bieng done to
uninitialized member variable of casted
pointer. cryptomgr_probe completes all
the waits when it completes itself. This
causes the number of wakes to exceed the
limit of 2.

This prevents swake_up_all_locked warnings.

Signed-off-by: John Mathew <john.mathew@unikie.com>
---
 crypto/api.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/crypto/api.c b/crypto/api.c
index d8ba54142620..b89c44c11c54 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -153,12 +153,9 @@ static struct crypto_alg *crypto_larval_add(const char *name, u32 type,
 
 void crypto_larval_kill(struct crypto_alg *alg)
 {
-	struct crypto_larval *larval = (void *)alg;
-
 	down_write(&crypto_alg_sem);
 	list_del(&alg->cra_list);
 	up_write(&crypto_alg_sem);
-	complete_all(&larval->completion);
 	crypto_alg_put(alg);
 }
 EXPORT_SYMBOL_GPL(crypto_larval_kill);
@@ -166,17 +163,9 @@ EXPORT_SYMBOL_GPL(crypto_larval_kill);
 static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
 {
 	struct crypto_larval *larval = (void *)alg;
-	long timeout;
-
-	timeout = wait_for_completion_killable_timeout(
-		&larval->completion, 60 * HZ);
 
 	alg = larval->adult;
-	if (timeout < 0)
-		alg = ERR_PTR(-EINTR);
-	else if (!timeout)
-		alg = ERR_PTR(-ETIMEDOUT);
-	else if (!alg)
+	if (!alg)
 		alg = ERR_PTR(-ENOENT);
 	else if (crypto_is_test_larval(larval) &&
 		 !(alg->cra_flags & CRYPTO_ALG_TESTED))
-- 
2.17.1


       reply	other threads:[~2019-12-13  9:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJz2qXnPquUZSeO9SWSmvLKcdhnT96KnD66F-oatdnotYkxS+A () mail ! gmail ! com>
2019-12-13  9:18 ` John Mathew [this message]
2019-12-18 16:47   ` [PATCH] Remove redundant wait for completion Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191213091843.8365-1-john.mathew@unikie.com \
    --to=john.mathew@unikie.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).