Wait queue question
If I have a wait queue thats I am using to wake up a device driver read from an interrupt service routine.
If I get three interrupt and three wake_up_interrables, will I need to execute three sleep_ons to get the wait queue back to the null state, or is it just back after the first sleep_on?
Chip
begin:vcard
n:Blach;Ralph
tel;work:919-543-1207
x-mozilla-html:TRUE
url:www.ibm.com
org:IBM MicroElectronics
adr:;;3039 Cornwallis ;RTP;NC;27709;USA
version:2.1
email;internet:[email protected]
x-mozilla-cpt:;15936
fn:Ralph Blach
end:vcard
Ralph> If I have a wait queue thats I am using to wake up a device Ralph> driver read from an interrupt service routine. If I get Ralph> three interrupt and three wake_up_interrables, will I need Ralph> to execute three sleep_ons to get the wait queue back to Ralph> the null state, or is it just back after the first Ralph> sleep_on?
You really don't want to use sleep_on() any more (Linux wants to remove it out for 2.5). Take a look at
<http://lwn.net/2001/0201/a/sleep-fix.php3>
for a safer way to sleep, or use the wait_event macro (in linux/sched.h).
Roland
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Hi Ralph, perhaps you could not attach your .vcf files anymore?
If your driver implements non-blocking read() and write() functions, then you don't have to sleep.
Else others have commented on the alternative to sleep_on().
For non-blocking:
Just use poll_wait() in your poll() function and wakeup_interruptible when there data available on your Qs.
Then user program's select() and poll() system calls will work properly.
Ron
Quoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Ralph Blach
Sent: Wednesday, February 14, 2001 7:05 AM
To: Embedded Linux list
Subject: Wait queue question
Quoted 7 lines
If I have a wait queue thats I am using to wake up a device driver read from an interrupt service routine.
If I get three interrupt and threewake_up_interrables, will I need to execute threesleep_onsto get the wait queue back to the null state, or is it just back after the firstsleep_on?Chip
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Roland,
Ok, but were is an example of how to use a wait_event macro. I dont see it in any of the documentation.
Chip
Quoted 11 lines · Roland Dreier
Ralph> If I have a wait queue thats I am using to wake up a device Ralph> driver read from an interrupt service routine. If I get Ralph> three interrupt and three
wake_up_interrables, will I need Ralph> to execute threesleep_onsto get the wait queue back to Ralph> the null state, or is it just back after the first Ralph>sleep_on?You really don't want to use
sleep_on()any more (Linux wants to remove it out for 2.5). Take a look at
Quoted 6 lines
<http://lwn.net/2001/0201/a/sleep-fix.php3>
for a safer way to sleep, or use the
wait_eventmacro (inlinux/sched.h).Roland
begin:vcard
n:Blach;Ralph
tel;work:919-543-1207
x-mozilla-html:TRUE
url:www.ibm.com
org:IBM MicroElectronics
adr:;;3039 Cornwallis ;RTP;NC;27709;USA
version:2.1
email;internet:[email protected]
x-mozilla-cpt:;15936
fn:Ralph Blach
end:vcard
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Ralph" == Ralph Blach <[email protected]> writes:
Ralph> Roland, Ok, but were is an example of how to use a Ralph> wait_event macro. I dont see it in any of the Ralph> documentation.
Documentation/DocBook/kernel-hacking.tmpl does mention wait_event(), although it's pretty short on details. But your best bet is just to grep through some driver sources and look at how people actually use it.
Roland
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/