<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Dave,<br>
<br>
I have confirmed the execution has go into <br>
<a href="http://lxr.linux.no/linux+*/+code=desc"
class="sref">desc</a>-><a
href="http://lxr.linux.no/linux+*/+code=irq_data" class="sref">irq_data</a>.<a
href="http://lxr.linux.no/linux+*/+code=chip" class="sref">chip</a>-><a
href="http://lxr.linux.no/linux+*/+code=irq_disable" class="sref">irq_disable</a>(&<a
href="http://lxr.linux.no/linux+*/+code=desc" class="sref">desc</a>-><a
href="http://lxr.linux.no/linux+*/+code=irq_data" class="sref">irq_data</a>);<br>
<pre class="done" id="a3/db/0efad3926c7d86517e5641dcd5f26deaf0a8_3/0">
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
        
</pre>
On 3/3/2011 6:49 AM, Dave Hylands wrote:
<blockquote
cite="mid:AANLkTimeKux1BSwucqmW12moF7zeH9RFeSCeGHPRpVkx@mail.gmail.com"
type="cite">
<pre wrap="">Hi Jacky,
Sending to the list as well.
On Tue, Mar 1, 2011 at 1:55 AM, Jacky Lam <a class="moz-txt-link-rfc2396E" href="mailto:lamshuyin@gmail.com"><lamshuyin@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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?
</pre>
</blockquote>
<pre wrap="">
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
</pre>
</blockquote>
<br>
</body>
</html>