From: Will Newton <will.newton@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Threaded irq handler question
Date: Thu, 22 Apr 2010 11:51:33 +0100 [thread overview]
Message-ID: <j2o87a5b0801004220351ze6948d6dn3d995122aff355b6@mail.gmail.com> (raw)
In-Reply-To: <20100421112807.5eca9f9d@bike.lwn.net>
On Wed, Apr 21, 2010 at 6:28 PM, Jonathan Corbet <corbet@lwn.net> wrote:
> On Wed, 21 Apr 2010 17:35:32 +0100
> Will Newton <will.newton@gmail.com> wrote:
>
>> My problem is that this structure does not work, because once I call
>> disable_irq_nosync() on the irq in the check handler the thread will
>> no longer run because the irq is disabled. However if I don't call
>> disable_irq_nosync() I will get endless irqs because the line is
>> level-triggered and will not be deasserted until the thread has run.
>
> Trying to disable IRQs at this level is the wrong approach. You need to
> do enough in the primary interrupt handler to cause the hardware to
> stop interrupting in the first place; usually that's just a matter of
> some sort of acknowledgment. Then the threaded handler can move data
> around in peace.
Unfortunately this device has no way of doing that - deasserting the
interrupt line involves doing i2c transactions which will likely sleep
so cannot be done in the check handler. This is quite a common problem
for i2c connected devices.
next prev parent reply other threads:[~2010-04-22 10:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 16:35 Will Newton
2010-04-21 17:28 ` Jonathan Corbet
2010-04-22 10:51 ` Will Newton [this message]
2010-04-22 1:37 ` Yong Zhang
2010-04-22 10:51 ` Will Newton
2010-04-23 13:30 ` Mark Brown
2010-04-23 13:29 ` Mark Brown
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=j2o87a5b0801004220351ze6948d6dn3d995122aff355b6@mail.gmail.com \
--to=will.newton@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®