All of lore.kernel.org
 help / color / mirror / Atom feed
From: Till Straumann <strauman@slac.stanford.edu>
To: linux-rt-users@vger.kernel.org
Subject: How to unblock a thread from  a hard isr (IRQF_NO_THREAD)
Date: Thu, 08 Nov 2012 16:28:48 -0600	[thread overview]
Message-ID: <509C3220.2050601@slac.stanford.edu> (raw)

Hello list.

I have a driver which is designed to do most work in user-space.
The ISR is really simple. It just ACKs/clears the interrupt and
then should unblock a waiting thread.
It seems overkill (and costs me about 5-10us) to use a threaded
interrupt in such a case (hard isr unblocks a kthread whose only
'work' is unblocking another (user) thread).

I have found some references where users try to do a similar
thing via UIO
(e.g.,
http://article.gmane.org/gmane.linux.rt.user/7372/
http://article.gmane.org/gmane.linux.rt.user/7676)

However, the succinct answer was along the line 'that can't work with UIO'.

IMHO it would be very helpful to get a more detailed explanation
as to why it doesn't work (i.e., what things you are and are not
allowed to do from a hard-isr under RT_PREEMPT). I suspect it is
because UIO calls routines such as 'kill_fasync' which use
ordinary (as opposed to raw) spinlocks which means that the
caller could be preempted (under RT_PREEMPT), right?

What *is* the recommended mechanism to wake up a thread from
a hard-isr?

It would IMHO be desirable to modify the UIO driver so that it
is possible to support non-threaded handlers.

Thanks for any enlightenment (and the fantastic rt-preempt patch
in the first place)!

- Till

PS: Please CC me on any replies; I am currently not a subscriber.

             reply	other threads:[~2012-11-08 22:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08 22:28 Till Straumann [this message]
2012-11-08 23:12 ` How to unblock a thread from a hard isr (IRQF_NO_THREAD) Tim Sander
2012-11-09  0:53   ` Till Straumann
     [not found]     ` <201211091518.36344.tim01@vlsi.informatik.tu-darmstadt.de>
2012-11-09 17:27       ` Till Straumann
2012-11-09  4:08 ` Josh Cartwright
2012-11-09  4:28   ` Till Straumann
2012-11-09  4:42     ` Josh Cartwright
2012-11-09  4:50       ` Till Straumann

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=509C3220.2050601@slac.stanford.edu \
    --to=strauman@slac.stanford.edu \
    --cc=linux-rt-users@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 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.