From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: adeos-main@gna.org
Subject: Re: [Adeos-main] wake_up_interruptible ?
Date: Mon, 23 Jan 2006 11:56:08 +0100 [thread overview]
Message-ID: <17364.46664.389729.166491@domain.hid> (raw)
In-Reply-To: <200601230144.31936.berlemont.hauw@domain.hid>
Alexis Berlemont wrote:
> Hi,
>
>
> > I've got a kernel module which creates a chrdev.
> > In the read file operation I have a interruptible_sleep_on.
> > Now I want to wake it up from an IPIPE interrupt handler
> > (i.e. unblock the read operation from user-space on the
> > chrdev), but I bet wake_up_interruptible is forbidden
> > in HRT context, isn't it ?
>
> Why not using a semaphore :
>
> in your read fops function :
>
> down_interruptible(pointer_read_sem);
>
> in your IPIPE interrupt handler:
>
> up(pointer_read_sem);
>
> In an interrupt handler, I think you can use a Linux semaphore. I am quite
> sure semaphores are used in the Xenomai pipe implementation.
For the "up" function to work properly, Linux scheduler data have to be
in a consistent state. But with the IPIPE patch, Linux may be preempted
by a higher priority domain at any point where hardware interrupts are
not disabled, and where scheduler data are not necessarily in a
consistent state.
One way to wake up a regular Linux thread from a higher priority domain
interrupt handler is to propagate this interrupt after HRT processing in
higher priority domains and run wake_up_interruptible from Linux domain
interrupt handler.
--
Gilles Chanteperdrix.
next prev parent reply other threads:[~2006-01-23 10:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-21 22:44 [Adeos-main] wake_up_interruptible ? Hannes Mayer
2006-01-23 0:44 ` Alexis Berlemont
2006-01-23 10:56 ` Gilles Chanteperdrix [this message]
2006-01-24 17:08 ` Hannes Mayer
2006-01-24 19:23 ` Hannes Mayer
2006-01-24 20:46 ` Alexis Berlemont
2006-01-24 21:16 ` Hannes Mayer
2006-01-27 16:44 ` Hannes Mayer
2006-01-29 10:50 ` Philippe Gerum
2006-01-30 13:48 ` Hannes Mayer
2006-01-24 21:08 ` Gilles Chanteperdrix
2006-01-24 21:20 ` Hannes Mayer
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=17364.46664.389729.166491@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=adeos-main@gna.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.