LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ming Liu" <eemingliu@hotmail.com>
To: Linuxppc-embedded@ozlabs.org
Subject: basic and stupid question on wait_event and wake_up
Date: Sun, 12 Aug 2007 13:57:01 +0000	[thread overview]
Message-ID: <BAY138-F25C6B0625737531B77D706B2E30@phx.gbl> (raw)

Dear all,
I am reading LDD(V3) chapter 6 on the topic of wait_event(queue, condition) 
and wake_up(queue) functions. I am quite confused on the sayings. One is 
"Until condition evaluates to a true value, the process continues to 
sleep", which looks like that 'condition' is the one who wake up the 
process from its sleeping. However the other saying is "The basic function 
that wakes up sleeping processes is called wake_up, and wake_up wakes up 
all processes waiting on the given queue" So who is the exact one to wake 
the sleeping process up at all, condition or wake_up? From my 
understanding, if the condition becomes true, then the sleeping process 
will leave its sleeping status and wake up. Then what's the use of wake_up 
function? 

My senario could be described as: in my char device driver, I use one ioctl 
command to initiate a DMA transfer. After all related registers are 
initiated, this process will be put to sleep for saving CPU cycles. In the 
interrupt handler which is for a DMA_done, I wake that process up and 
resume its following executing. With this method, in my application program 
if I release a DMA initiation command, it is a Blocking operation and it 
will wait until the DMA transfer is done. 

Perhaps my question is quite simple or basic. Thanks for any explanation 
and comment on this topic in my senario from you experts. Thanks a lot.

Br
Ming

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

             reply	other threads:[~2007-08-12 13:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-12 13:57 Ming Liu [this message]
2007-08-13  7:54 ` basic and stupid question on wait_event and wake_up Domen Puncer
2007-08-13  8:33   ` Ming Liu
2007-08-13  8:47     ` Domen Puncer
2007-08-13  9:22       ` Ming Liu
2007-08-13  9:30         ` Laurent Pinchart
2007-08-13  9:31         ` Domen Puncer
2007-08-13  9:46           ` Ming Liu

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=BAY138-F25C6B0625737531B77D706B2E30@phx.gbl \
    --to=eemingliu@hotmail.com \
    --cc=Linuxppc-embedded@ozlabs.org \
    /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