From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: interruptible_sleep_on, interrupts and device drivers
Date: Sat, 15 Oct 2005 14:21:55 -0600 [thread overview]
Message-ID: <435164E3.9000001@shaw.ca> (raw)
In-Reply-To: <4XQZI-5QC-1@gated-at.bofh.it>
Gabriele Brugnoni wrote:
> But:
> If the test is made with IRQ closed, and IRQ are then enabled after the test
> but before the call to interruptible_sleep_on, what happen if the handler
> break the procedure immediately before entering the interruptible_sleep_on
> function ?
> I beleave that the interrupt handler, calling the wakeup function, will not
> wake our process, because is not in the waiting list. But at return from
> IRQ handler, the process will continue execution calling the sleep
> function, and nobody will wake it because the data is now already available.
This is why interruptible_sleep_on is deprecated and should not be used
anymore. The wait_event_interruptible, etc. functions avoid this race
since the condition is tested after the caller is put into the wait
queue, so if the condition is true you are guaranteed to be woken up.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2005-10-15 20:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4XQZI-5QC-1@gated-at.bofh.it>
2005-10-15 20:21 ` Robert Hancock [this message]
2005-10-15 10:29 interruptible_sleep_on, interrupts and device drivers Gabriele Brugnoni
2005-10-15 10:36 ` Arjan van de Ven
2005-10-15 10:57 ` Russell King
-- strict thread matches above, loose matches on Subject: below --
2005-10-15 10:00 Gabriele Brugnoni
2005-10-15 10:05 ` Arjan van de Ven
2005-10-15 13:01 ` Tushar Adeshara
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=435164E3.9000001@shaw.ca \
--to=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.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