From: enrico.scholz@sigma-chemnitz.de (Enrico Scholz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] gpio/mxs: support irqs triggered by both edges
Date: Mon, 12 Mar 2012 18:38:53 +0100 [thread overview]
Message-ID: <lyd38h4t3m.fsf@ensc-virt.intern.sigma-chemnitz.de> (raw)
In-Reply-To: <CACxGe6uOtgqb1GcBUCDY3L7B5THg1_set0pNcxkzZihr2y9==Q@mail.gmail.com> (Grant Likely's message of "Mon, 12 Mar 2012 11:17:27 -0600")
Grant Likely <grant.likely@secretlab.ca> writes:
>>>> iMX28 silicon does not support irqs triggered by both gpio edges. Patch
>>>> emulates this behavior by configuring such irqs as level triggered and
>>>> by switching polarity in the interrupt handler.
>>>
>>> That looks dodgy and hacky. ?This will definitely miss interrupts if
>>> they come in too fast.
>>
>> Because patch calculates the trigger from the actual level, there should
>> not be missed more interrupts than with native edge-both support.
>
> Edge interrupt controllers latch interrupt requests. so that nothing
> gets missed. Level interrupt controllers do not.
iMX28 hardware sets interrupt status only but never clears it[1]. E.g. when
the requested level has been seen, the interrupt is pending until software
clears it. It does not matter whether level changes back or stays asserted.
> So, if the irq line toggles 3 times before the handling code gets
> executed, then the kernel will still only recognize 1 irq, not 3.
There is no difference to edge triggered interrupts. When the trigger
events happen too fast, not all of them can be handled. But both for
edge and for level triggered interrupts, the interrupt handler will be
executed at least once.
Enrico
Footnotes:
[1] see figure "Figure 9-5. GPIO Interrupt Generation", page 688 in
"i.MX28 Applications Processor Reference Manual, Rev. 1, 2010"
prev parent reply other threads:[~2012-03-12 17:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 13:52 [PATCH] gpio/mxs: support irqs triggered by both edges Enrico Scholz
2012-03-12 16:35 ` Grant Likely
2012-03-12 17:02 ` Enrico Scholz
2012-03-12 17:17 ` Grant Likely
2012-03-12 17:38 ` Enrico Scholz [this message]
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=lyd38h4t3m.fsf@ensc-virt.intern.sigma-chemnitz.de \
--to=enrico.scholz@sigma-chemnitz.de \
--cc=linux-arm-kernel@lists.infradead.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