From: lamshuyin@gmail.com (Jacky Lam)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Disabling an interrupt
Date: Thu, 03 Mar 2011 09:26:26 +0800 [thread overview]
Message-ID: <4D6EEE42.10909@gmail.com> (raw)
In-Reply-To: <AANLkTimeKux1BSwucqmW12moF7zeH9RFeSCeGHPRpVkx@mail.gmail.com>
Hi Dave,
I have confirmed the execution has go into
desc <http://lxr.linux.no/linux+*/+code=desc>->irq_data
<http://lxr.linux.no/linux+*/+code=irq_data>.chip
<http://lxr.linux.no/linux+*/+code=chip>->irq_disable
<http://lxr.linux.no/linux+*/+code=irq_disable>(&desc
<http://lxr.linux.no/linux+*/+code=desc>->irq_data
<http://lxr.linux.no/linux+*/+code=irq_data>);
However, irq_disable points to kernel/irq/chip.c:default_disable() which do nothings.
Unlike default_enable() which called by enable_irq() will unmask the IRQ accordingly.
I don't understand the reason behind.
BR,
Jacky
On 3/3/2011 6:49 AM, Dave Hylands wrote:
> Hi Jacky,
>
> Sending to the list as well.
>
> On Tue, Mar 1, 2011 at 1:55 AM, Jacky Lam<lamshuyin@gmail.com> wrote:
>> Hi,
>>
>> It's long before when I want to enable/disable an interrupt, I call
>> enable_irq()/disable_irq(). However, recently, I do that again.
>> disable_irq() do nothing. I looked into the code and find disable_irq()
>> is pointing to a empty function default_disable(). This change is
>> started from 2.6.20.
>>
>> I want to know what should I do if I want to disable an interrupt now?
> So disable/enable_irq are nestable, and you're expected to call them
> in the order disable/enable.
>
> You need to call enable_irq exactly the same number of times that you
> call disable_irq.
>
> If you start wth inerrtupts enabled and do
> enable_irq
> ...do some stuff...
> disable_irq
>
> then disable_irq will do nothing since it just decremented the count
> that enable_irq incremented.
>
> Another way of looking at it is that disable_irq increments a count,
> and enable_irq decrements a count.
> The interrupt is only "really" disabled when the count transitions
> from 0 to 1, and the interrupt is only "really" enabled when the count
> transitions from 1 to 0.
>
> Dave Hylands
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110303/d0660954/attachment.html
next prev parent reply other threads:[~2011-03-03 1:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 8:55 Disabling an interrupt Jacky Lam
2011-03-02 22:15 ` Sri Ram Vemulpali
2011-03-02 22:49 ` Dave Hylands
2011-03-03 1:26 ` Jacky Lam [this message]
2011-03-03 2:51 ` Dave Hylands
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=4D6EEE42.10909@gmail.com \
--to=lamshuyin@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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).