From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: Bottom half trigger function never called when using the sysfs trigger
Date: Fri, 15 Jun 2012 14:32:34 +0100 [thread overview]
Message-ID: <4FDB3972.8090209@kernel.org> (raw)
In-Reply-To: <4FDB33CD.2090805@metafoo.de>
On 6/15/2012 2:08 PM, Lars-Peter Clausen wrote:
> hi,
>
> The sysfs trigger uses iio_trigger_poll_chained which calls
> handle_nested_irq. The problem now is that for nested IRQs the primary
> handler is not called. Which obviously breaks drivers which have a bottom
> half trigger function.
>
> This behaviour was introduced in commit 1f785681 ("staging:iio:trigger sysfs
> userspace trigger rework."). The commit message says you are "awaiting
> comments on using the nested_irq_trick", but not why it is necessary to use
> nested IRQs. And honestly I don't get why it would be necessary either.
> handle_nested_irq is supposed to be used with chained IRQs if we are already
> running in a thread handler of parent. Neither seems to be true here.
It was a while ago so my memory is rather sketchy.
do you meant the bottom half? Unless I'm very confused its the top half
that doesn't
get called.. handle_nested_irq calls thread_fn which is the bottom half.
It's the only way I've come up with for cleanly running through our
trigger distribution
given that is all irq based. Top halves expect to be run in interrupt
mode. I don't know
of any way to ensure this is true if one is 'creating' the interrupt
from software.
I did wonder at the time about putting an explicit call of the interrupt
handler in
to deal with the missing top halves. It's rather uggly though and
suffers from things
not being run in the state they expect to be run in....
Other suggestions welcome.
next prev parent reply other threads:[~2012-06-15 13:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 13:08 Bottom half trigger function never called when using the sysfs trigger Lars-Peter Clausen
2012-06-15 13:32 ` Jonathan Cameron [this message]
2012-06-15 14:57 ` Lars-Peter Clausen
2012-06-15 14:59 ` Jonathan Cameron
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=4FDB3972.8090209@kernel.org \
--to=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).