From: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
To: <akpm@linux-foundation.org>, <ionut.m.alexa@gmail.com>,
<mark.yang@spreadtrum.com>, <wei.qiao@spreadtrum.com>,
<geng.ren@spreadtrum.com>
Cc: <orson.zhai@spreadtrum.com>, <zhizhou.zhang@spreadtrum.com>,
<ke.wang@spreadtrum.com>, <zhang.lyra@gmail.com>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] kernel: async: Fixed the wrong waitting condition of wait_event
Date: Mon, 5 Jan 2015 11:35:35 +0800 [thread overview]
Message-ID: <1420428935-30385-1-git-send-email-chunyan.zhang@spreadtrum.com> (raw)
In-Reply-To: <async>
From: Yonghui Yang <mark.yang@spreadtrum.com>
This patch changes the waitting condition of wait_event in the
function 'async_synchronize_cookie_domain'.
This function waits until all asynchronous function calls for the certain
domain have been done.
But, the function 'lowest_in_progress' returns the lowest *pending*
entry's cookie.
So we should make sure that the return value of lowest_in_progress(domain)
must be larger than @cookie.
Verified-by: Wei Qiao <wei.qiao@spreadtrum.com>
Signed-off-by: Yonghui Yang <mark.yang@spreadtrum.com>
Signed-off-by: Geng Ren <geng.ren@spreadtrum.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
---
kernel/async.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/async.c b/kernel/async.c
index 4c3773c..894ae80 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -267,7 +267,7 @@ EXPORT_SYMBOL_GPL(async_unregister_domain);
*/
void async_synchronize_full_domain(struct async_domain *domain)
{
- async_synchronize_cookie_domain(ASYNC_COOKIE_MAX, domain);
+ async_synchronize_cookie_domain(ASYNC_COOKIE_MAX-1, domain);
}
EXPORT_SYMBOL_GPL(async_synchronize_full_domain);
@@ -289,7 +289,7 @@ void async_synchronize_cookie_domain(async_cookie_t cookie, struct async_domain
starttime = ktime_get();
}
- wait_event(async_done, lowest_in_progress(domain) >= cookie);
+ wait_event(async_done, lowest_in_progress(domain) > cookie);
if (initcall_debug && system_state == SYSTEM_BOOTING) {
endtime = ktime_get();
--
1.7.9.5
next parent reply other threads:[~2015-01-05 3:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <async>
2015-01-05 3:35 ` Chunyan Zhang [this message]
2015-01-08 0:37 ` Andrew Morton
2015-01-08 0:39 ` Andrew Morton
2015-01-08 6:20 ` Chunyan Zhang (张春艳)
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=1420428935-30385-1-git-send-email-chunyan.zhang@spreadtrum.com \
--to=chunyan.zhang@spreadtrum.com \
--cc=akpm@linux-foundation.org \
--cc=geng.ren@spreadtrum.com \
--cc=ionut.m.alexa@gmail.com \
--cc=ke.wang@spreadtrum.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.yang@spreadtrum.com \
--cc=orson.zhai@spreadtrum.com \
--cc=wei.qiao@spreadtrum.com \
--cc=zhang.lyra@gmail.com \
--cc=zhizhou.zhang@spreadtrum.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
all inboxes | Powered by JetHome®