<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/kernel/irq/spurious.c, branch v2.6.32</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>genirq: try_one_irq() must be called with irq disabled</title>
<updated>2009-11-07T20:44:45+00:00</updated>
<author>
<name>Yong Zhang</name>
<email>yong.zhang0@gmail.com</email>
</author>
<published>2009-11-07T03:16:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e7e7e0c084ef862d5754701108d4a038514d6314'/>
<id>e7e7e0c084ef862d5754701108d4a038514d6314</id>
<content type='text'>
Prarit reported:
=================================
[ INFO: inconsistent lock state ]
2.6.32-rc5 #1
---------------------------------
inconsistent {IN-HARDIRQ-W} -&gt; {HARDIRQ-ON-W} usage.
swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
 (&amp;irq_desc_lock_class){?.-...}, at: [&lt;ffffffff810c264e&gt;] try_one_irq+0x32/0x138
{IN-HARDIRQ-W} state was registered at:
 [&lt;ffffffff81095160&gt;] __lock_acquire+0x2fc/0xd5d
 [&lt;ffffffff81095cb4&gt;] lock_acquire+0xf3/0x12d
 [&lt;ffffffff814cdadd&gt;] _spin_lock+0x40/0x89
 [&lt;ffffffff810c3389&gt;] handle_level_irq+0x30/0x105
 [&lt;ffffffff81014e0e&gt;] handle_irq+0x95/0xb7
 [&lt;ffffffff810141bd&gt;] do_IRQ+0x6a/0xe0
 [&lt;ffffffff81012813&gt;] ret_from_intr+0x0/0x16
irq event stamp: 195096
hardirqs last  enabled at (195096): [&lt;ffffffff814cd7f7&gt;] _spin_unlock_irq+0x3a/0x5c
hardirqs last disabled at (195095): [&lt;ffffffff814cdbdd&gt;] _spin_lock_irq+0x29/0x95
softirqs last  enabled at (195088): [&lt;ffffffff81068c92&gt;] __do_softirq+0x1c1/0x1ef
softirqs last disabled at (195093): [&lt;ffffffff8101304c&gt;] call_softirq+0x1c/0x30

other info that might help us debug this:
1 lock held by swapper/0:
 #0:  (kernel/irq/spurious.c:21){+.-...}, at: [&lt;ffffffff81070cf2&gt;]
run_timer_softirq+0x1a9/0x315

stack backtrace:
Pid: 0, comm: swapper Not tainted 2.6.32-rc5 #1
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81093e94&gt;] valid_state+0x187/0x1ae
 [&lt;ffffffff81093fe4&gt;] mark_lock+0x129/0x253
 [&lt;ffffffff810951d4&gt;] __lock_acquire+0x370/0xd5d
 [&lt;ffffffff81095cb4&gt;] lock_acquire+0xf3/0x12d
 [&lt;ffffffff814cdadd&gt;] _spin_lock+0x40/0x89
 [&lt;ffffffff810c264e&gt;] try_one_irq+0x32/0x138
 [&lt;ffffffff810c2795&gt;] poll_all_shared_irqs+0x41/0x6d
 [&lt;ffffffff810c27dd&gt;] poll_spurious_irqs+0x1c/0x49
 [&lt;ffffffff81070d82&gt;] run_timer_softirq+0x239/0x315
 [&lt;ffffffff81068bd3&gt;] __do_softirq+0x102/0x1ef
 [&lt;ffffffff8101304c&gt;] call_softirq+0x1c/0x30
 [&lt;ffffffff81014b65&gt;] do_softirq+0x59/0xca
 [&lt;ffffffff810686ad&gt;] irq_exit+0x58/0xae
 [&lt;ffffffff81029b84&gt;] smp_apic_timer_interrupt+0x94/0xba
 [&lt;ffffffff81012a33&gt;] apic_timer_interrupt+0x13/0x20

The reason is that try_one_irq() is called from hardirq context with
interrupts disabled and from softirq context (poll_all_shared_irqs())
with interrupts enabled.

Disable interrupts before calling it from poll_all_shared_irqs().

Reported-and-tested-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: Yong Zhang &lt;yong.zhang0@gmail.com&gt;
LKML-Reference: &lt;1257563773-4620-1-git-send-email-yong.zhang0@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prarit reported:
=================================
[ INFO: inconsistent lock state ]
2.6.32-rc5 #1
---------------------------------
inconsistent {IN-HARDIRQ-W} -&gt; {HARDIRQ-ON-W} usage.
swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
 (&amp;irq_desc_lock_class){?.-...}, at: [&lt;ffffffff810c264e&gt;] try_one_irq+0x32/0x138
{IN-HARDIRQ-W} state was registered at:
 [&lt;ffffffff81095160&gt;] __lock_acquire+0x2fc/0xd5d
 [&lt;ffffffff81095cb4&gt;] lock_acquire+0xf3/0x12d
 [&lt;ffffffff814cdadd&gt;] _spin_lock+0x40/0x89
 [&lt;ffffffff810c3389&gt;] handle_level_irq+0x30/0x105
 [&lt;ffffffff81014e0e&gt;] handle_irq+0x95/0xb7
 [&lt;ffffffff810141bd&gt;] do_IRQ+0x6a/0xe0
 [&lt;ffffffff81012813&gt;] ret_from_intr+0x0/0x16
irq event stamp: 195096
hardirqs last  enabled at (195096): [&lt;ffffffff814cd7f7&gt;] _spin_unlock_irq+0x3a/0x5c
hardirqs last disabled at (195095): [&lt;ffffffff814cdbdd&gt;] _spin_lock_irq+0x29/0x95
softirqs last  enabled at (195088): [&lt;ffffffff81068c92&gt;] __do_softirq+0x1c1/0x1ef
softirqs last disabled at (195093): [&lt;ffffffff8101304c&gt;] call_softirq+0x1c/0x30

other info that might help us debug this:
1 lock held by swapper/0:
 #0:  (kernel/irq/spurious.c:21){+.-...}, at: [&lt;ffffffff81070cf2&gt;]
run_timer_softirq+0x1a9/0x315

stack backtrace:
Pid: 0, comm: swapper Not tainted 2.6.32-rc5 #1
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81093e94&gt;] valid_state+0x187/0x1ae
 [&lt;ffffffff81093fe4&gt;] mark_lock+0x129/0x253
 [&lt;ffffffff810951d4&gt;] __lock_acquire+0x370/0xd5d
 [&lt;ffffffff81095cb4&gt;] lock_acquire+0xf3/0x12d
 [&lt;ffffffff814cdadd&gt;] _spin_lock+0x40/0x89
 [&lt;ffffffff810c264e&gt;] try_one_irq+0x32/0x138
 [&lt;ffffffff810c2795&gt;] poll_all_shared_irqs+0x41/0x6d
 [&lt;ffffffff810c27dd&gt;] poll_spurious_irqs+0x1c/0x49
 [&lt;ffffffff81070d82&gt;] run_timer_softirq+0x239/0x315
 [&lt;ffffffff81068bd3&gt;] __do_softirq+0x102/0x1ef
 [&lt;ffffffff8101304c&gt;] call_softirq+0x1c/0x30
 [&lt;ffffffff81014b65&gt;] do_softirq+0x59/0xca
 [&lt;ffffffff810686ad&gt;] irq_exit+0x58/0xae
 [&lt;ffffffff81029b84&gt;] smp_apic_timer_interrupt+0x94/0xba
 [&lt;ffffffff81012a33&gt;] apic_timer_interrupt+0x13/0x20

The reason is that try_one_irq() is called from hardirq context with
interrupts disabled and from softirq context (poll_all_shared_irqs())
with interrupts enabled.

Disable interrupts before calling it from poll_all_shared_irqs().

Reported-and-tested-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: Yong Zhang &lt;yong.zhang0@gmail.com&gt;
LKML-Reference: &lt;1257563773-4620-1-git-send-email-yong.zhang0@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq: Clean up by removing irqfixup MODULE_PARM_DESC()</title>
<updated>2009-08-04T15:00:11+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jirislaby@gmail.com</email>
</author>
<published>2009-07-30T22:02:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=990a55eb25d9698d61352264cc43f3a9c04cce90'/>
<id>990a55eb25d9698d61352264cc43f3a9c04cce90</id>
<content type='text'>
It's wrong (the parm takes no arguments) and compile-time wiped
away anyway (due to !MODULE).

Signed-off-by: Jiri Slaby &lt;jirislaby@gmail.com&gt;
LKML-Reference: &lt;1248991326-26267-1-git-send-email-jirislaby@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's wrong (the parm takes no arguments) and compile-time wiped
away anyway (due to !MODULE).

Signed-off-by: Jiri Slaby &lt;jirislaby@gmail.com&gt;
LKML-Reference: &lt;1248991326-26267-1-git-send-email-jirislaby@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq: provide debug_poll_all_shared_irqs() method under CONFIG_DEBUG_SHIRQ</title>
<updated>2009-01-16T16:46:49+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-01-16T16:43:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=74296a8ed6aa3c5bf672808ada690de7ba323ecc'/>
<id>74296a8ed6aa3c5bf672808ada690de7ba323ecc</id>
<content type='text'>
Provide a shared interrupt debug facility under CONFIG_DEBUG_SHIRQ:
it uses the existing irqpoll facilities to iterate through all
registered interrupt handlers and call those which can handle shared
IRQ lines.

This can be handy for suspend/resume debugging: if we call this function
early during resume we can trigger crashes in those drivers which have
incorrect assumptions about when exactly their ISRs will be called
during suspend/resume.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide a shared interrupt debug facility under CONFIG_DEBUG_SHIRQ:
it uses the existing irqpoll facilities to iterate through all
registered interrupt handlers and call those which can handle shared
IRQ lines.

This can be handy for suspend/resume debugging: if we call this function
early during resume we can trigger crashes in those drivers which have
incorrect assumptions about when exactly their ISRs will be called
during suspend/resume.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq: simplify for_each_irq_desc() usage</title>
<updated>2008-12-26T08:48:18+00:00</updated>
<author>
<name>KOSAKI Motohiro</name>
<email>kosaki.motohiro@jp.fujitsu.com</email>
</author>
<published>2008-12-26T03:29:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=18eefedfe8ad33e8fc7614c13359e29a9fab4644'/>
<id>18eefedfe8ad33e8fc7614c13359e29a9fab4644</id>
<content type='text'>
Impact: cleanup

all for_each_irq_desc() usage point have !desc check.
then its check can move into for_each_irq_desc() macro.

Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Acked-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: cleanup

all for_each_irq_desc() usage point have !desc check.
then its check can move into for_each_irq_desc() macro.

Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Acked-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sparse irq_desc[] array: core kernel and x86 changes</title>
<updated>2008-12-08T13:31:51+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yinghai@kernel.org</email>
</author>
<published>2008-12-06T02:58:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0b8f1efad30bd58f89961b82dfe68b9edf8fd2ac'/>
<id>0b8f1efad30bd58f89961b82dfe68b9edf8fd2ac</id>
<content type='text'>
Impact: new feature

Problem on distro kernels: irq_desc[NR_IRQS] takes megabytes of RAM with
NR_CPUS set to large values. The goal is to be able to scale up to much
larger NR_IRQS value without impacting the (important) common case.

To solve this, we generalize irq_desc[NR_IRQS] to an (optional) array of
irq_desc pointers.

When CONFIG_SPARSE_IRQ=y is used, we use kzalloc_node to get irq_desc,
this also makes the IRQ descriptors NUMA-local (to the site that calls
request_irq()).

This gets rid of the irq_cfg[] static array on x86 as well: irq_cfg now
uses desc-&gt;chip_data for x86 to store irq_cfg.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: new feature

Problem on distro kernels: irq_desc[NR_IRQS] takes megabytes of RAM with
NR_CPUS set to large values. The goal is to be able to scale up to much
larger NR_IRQS value without impacting the (important) common case.

To solve this, we generalize irq_desc[NR_IRQS] to an (optional) array of
irq_desc pointers.

When CONFIG_SPARSE_IRQ=y is used, we use kzalloc_node to get irq_desc,
this also makes the IRQ descriptors NUMA-local (to the site that calls
request_irq()).

This gets rid of the irq_cfg[] static array on x86 as well: irq_cfg now
uses desc-&gt;chip_data for x86 to store irq_cfg.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: cleanup the sparseirq modifications</title>
<updated>2008-10-16T14:53:29+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2008-10-16T07:55:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d3c60047bdb03199b93497ac40bd531315d43a86'/>
<id>d3c60047bdb03199b93497ac40bd531315d43a86</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq: fix irqpoll &amp;&amp; sparseirq</title>
<updated>2008-10-16T14:53:10+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yhlu.kernel@gmail.com</email>
</author>
<published>2008-09-15T08:53:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e00585bb7fc3d0b601181b765a254df7ff4ea59b'/>
<id>e00585bb7fc3d0b601181b765a254df7ff4ea59b</id>
<content type='text'>
Steven Noonan reported a boot hang when using irqpoll and
CONFIG_HAVE_SPARSE_IRQ=y.

The irqpoll loop needs to be updated to not iterate from 1 to nr_irqs
but to iterate via for_each_irq_desc(). (in the former case desc can
be NULL which crashes the box)

Reported-by: Steven Noonan &lt;steven@uplinklabs.net&gt;
Tested-by: Steven Noonan &lt;steven@uplinklabs.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steven Noonan reported a boot hang when using irqpoll and
CONFIG_HAVE_SPARSE_IRQ=y.

The irqpoll loop needs to be updated to not iterate from 1 to nr_irqs
but to iterate via for_each_irq_desc(). (in the former case desc can
be NULL which crashes the box)

Reported-by: Steven Noonan &lt;steven@uplinklabs.net&gt;
Tested-by: Steven Noonan &lt;steven@uplinklabs.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>generic: sparse irqs: use irq_desc() together with dyn_array, instead of irq_desc[]</title>
<updated>2008-10-16T14:52:29+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yhlu.kernel@gmail.com</email>
</author>
<published>2008-08-20T03:50:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=08678b0841267c1d00d771fe01548d86043d065e'/>
<id>08678b0841267c1d00d771fe01548d86043d065e</id>
<content type='text'>
add CONFIG_HAVE_SPARSE_IRQ to for use condensed array.
Get rid of irq_desc[] array assumptions.

Preallocate 32 irq_desc, and irq_desc() will try to get more.

( No change in functionality is expected anywhere, except the odd build
  failure where we missed a code site or where a crossing commit itroduces
  new irq_desc[] usage. )

v2: according to Eric, change get_irq_desc() to irq_desc()

Signed-off-by: Yinghai Lu &lt;yhlu.kernel@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
add CONFIG_HAVE_SPARSE_IRQ to for use condensed array.
Get rid of irq_desc[] array assumptions.

Preallocate 32 irq_desc, and irq_desc() will try to get more.

( No change in functionality is expected anywhere, except the odd build
  failure where we missed a code site or where a crossing commit itroduces
  new irq_desc[] usage. )

v2: according to Eric, change get_irq_desc() to irq_desc()

Signed-off-by: Yinghai Lu &lt;yhlu.kernel@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq: introduce nr_irqs</title>
<updated>2008-10-16T14:52:05+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yhlu.kernel@gmail.com</email>
</author>
<published>2008-08-20T03:49:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=85c0f90978bf50596dbd23854648020f1f9b5bfd'/>
<id>85c0f90978bf50596dbd23854648020f1f9b5bfd</id>
<content type='text'>
at this point nr_irqs is equal NR_IRQS

convert a few easy users from NR_IRQS to dynamic nr_irqs.

v2: according to Eric, we need to take care of arch without generic_hardirqs

Signed-off-by: Yinghai Lu &lt;yhlu.kernel@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
at this point nr_irqs is equal NR_IRQS

convert a few easy users from NR_IRQS to dynamic nr_irqs.

v2: according to Eric, we need to take care of arch without generic_hardirqs

Signed-off-by: Yinghai Lu &lt;yhlu.kernel@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: enable polling for disabled screaming irqs</title>
<updated>2008-07-18T17:21:13+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2008-07-10T21:48:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f84dbb912f344270f31d5cce974f12908a47798d'/>
<id>f84dbb912f344270f31d5cce974f12908a47798d</id>
<content type='text'>
When we disable a screaming irq we never see it again.  If the irq
line is shared or if the driver half works this is a real pain.  So
periodically poll the handlers for screaming interrupts.

I use a timer instead of the classic irq poll technique of working off
the timer interrupt because when we use the local apic timers
note_interrupt is never called (bug?).  Further on a system with
dynamic ticks the timer interrupt might not even fire unless there is
a timer telling it it needs to.

I forced this case on my test system with an e1000 nic and my ssh
session remained responsive despite the interrupt handler only being
called every 10th of a second.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we disable a screaming irq we never see it again.  If the irq
line is shared or if the driver half works this is a real pain.  So
periodically poll the handlers for screaming interrupts.

I use a timer instead of the classic irq poll technique of working off
the timer interrupt because when we use the local apic timers
note_interrupt is never called (bug?).  Further on a system with
dynamic ticks the timer interrupt might not even fire unless there is
a timer telling it it needs to.

I forced this case on my test system with an e1000 nic and my ssh
session remained responsive despite the interrupt handler only being
called every 10th of a second.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
</feed>
