<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/irq, branch v2.6.24</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.24</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.24'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2007-12-18T17:05:58Z</updated>
<entry>
<title>genirq: revert lazy irq disable for simple irqs</title>
<updated>2007-12-18T17:05:58Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2007-12-18T17:05:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=971e5b35fb02c5088d49e6c024aab73582a35b71'/>
<id>urn:sha1:971e5b35fb02c5088d49e6c024aab73582a35b71</id>
<content type='text'>
In commit 76d2160147f43f982dfe881404cfde9fd0a9da21 lazy irq disabling
was implemented, and the simple irq handler had a masking set to it.

Remy Bohmer discovered that some devices in the ARM architecture
would trigger the mask, but never unmask it. His patch to do the
unmasking was questioned by Russell King about masking simple irqs
to begin with. Looking further, it was discovered that the problems
Remy was seeing was due to improper use of the simple handler by
devices, and he later submitted patches to fix those. But the issue
that was uncovered was that the simple handler should never mask.

This patch reverts the masking in the simple handler.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>__do_IRQ does not check IRQ_DISABLED when IRQ_PER_CPU is set</title>
<updated>2007-11-15T02:45:43Z</updated>
<author>
<name>Russ Anderson</name>
<email>rja@sgi.com</email>
</author>
<published>2007-11-15T01:00:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c642b8391cf8efc3622cc97329a0f46e7cbb70b8'/>
<id>urn:sha1:c642b8391cf8efc3622cc97329a0f46e7cbb70b8</id>
<content type='text'>
In __do_IRQ(), the normal case is that IRQ_DISABLED is checked and if set
the handler (handle_IRQ_event()) is not called.

Earlier in __do_IRQ(), if IRQ_PER_CPU is set the code does not check
IRQ_DISABLED and calls the handler even though IRQ_DISABLED is set.  This
behavior seems unintentional.

One user encountering this behavior is the CPE handler (in
arch/ia64/kernel/mca.c).  When the CPE handler encounters too many CPEs
(such as a solid single bit error), it sets up a polling timer and disables
the CPE interrupt (to avoid excessive overhead logging the stream of single
bit errors).  disable_irq_nosync() is called which sets IRQ_DISABLED.  The
IRQ_PER_CPU flag was previously set (in ia64_mca_late_init()).  The net
result is the CPE handler gets called even though it is marked disabled.

If the behavior of not checking IRQ_DISABLED when IRQ_PER_CPU is set is
intentional, it would be worthy of a comment describing the intended
behavior.  disable_irq_nosync() does call chip-&gt;disable() to provide a
chipset specifiec interface for disabling the interrupt, which avoids this
issue when used.

Signed-off-by: Russ Anderson &lt;rja@sgi.com&gt;
Cc: "Luck, Tony" &lt;tony.luck@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Bjorn Helgaas &lt;bjorn.helgaas@hp.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Fix synchronize_irq races with IRQ handler</title>
<updated>2007-10-23T16:01:31Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2007-10-23T03:26:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a98ce5c6feead6bfedefabd46cb3d7f5be148d9a'/>
<id>urn:sha1:a98ce5c6feead6bfedefabd46cb3d7f5be148d9a</id>
<content type='text'>
As it is some callers of synchronize_irq rely on memory barriers
to provide synchronisation against the IRQ handlers.  For example,
the tg3 driver does

	tp-&gt;irq_sync = 1;
	smp_mb();
	synchronize_irq();

and then in the IRQ handler:

	if (!tp-&gt;irq_sync)
		netif_rx_schedule(dev, &amp;tp-&gt;napi);

Unfortunately memory barriers only work well when they come in
pairs.  Because we don't actually have memory barriers on the
IRQ path, the memory barrier before the synchronize_irq() doesn't
actually protect us.

In particular, synchronize_irq() may return followed by the
result of netif_rx_schedule being made visible.

This patch (mostly written by Linus) fixes this by using spin
locks instead of memory barries on the synchronize_irq() path.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Compile handle_percpu_irq even for uniprocessor kernels</title>
<updated>2007-10-17T15:43:00Z</updated>
<author>
<name>Ralf Baechle</name>
<email>ralf@linux-mips.org</email>
</author>
<published>2007-10-17T06:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28e3fed8b79c76450f264e77c58d0f5fbd2dd739'/>
<id>urn:sha1:28e3fed8b79c76450f264e77c58d0f5fbd2dd739</id>
<content type='text'>
Compiling handle_percpu_irq only on uniprocessor generates an artificial
special case so a typical use like:

  set_irq_chip_and_handler(irq, &amp;some_irq_type, handle_percpu_irq);

needs to be conditionally compiled only on SMP systems as well and an
alternative UP construct is usually needed - for no good reason.

This fixes uniprocessor configurations for some MIPS SMP systems.

Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Fix CONFIG_DEBUG_SHIRQ trigger on free_irq()</title>
<updated>2007-10-17T15:42:49Z</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2007-10-17T06:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d99493b3a68e40e56459ea3565d4402fb6e5f3a'/>
<id>urn:sha1:1d99493b3a68e40e56459ea3565d4402fb6e5f3a</id>
<content type='text'>
Andy Gospodarek pointed out that because we return in the middle of the
free_irq() function, we never actually do call the IRQ handler that just
got deregistered. This should fix it, although I expect Andrew will want
to convert those 'return's to 'break'. That's a separate change though.

Signed-off-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Andy Gospodarek &lt;andy@greyhouse.net&gt;
Cc: Fernando Luis Vzquez Cao &lt;fernando@oss.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>request_irq: fix DEBUG_SHIRQ handling</title>
<updated>2007-08-31T08:42:23Z</updated>
<author>
<name>Jarek Poplawski</name>
<email>jarkao2@o2.pl</email>
</author>
<published>2007-08-31T06:56:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59845b1ffd9121e5ef474ea5f27405fd7a83c85b'/>
<id>urn:sha1:59845b1ffd9121e5ef474ea5f27405fd7a83c85b</id>
<content type='text'>
Mariusz Kozlowski reported lockdep's warning:

&gt; =================================
&gt; [ INFO: inconsistent lock state ]
&gt; 2.6.23-rc2-mm1 #7
&gt; ---------------------------------
&gt; inconsistent {in-hardirq-W} -&gt; {hardirq-on-W} usage.
&gt; ifconfig/5492 [HC0[0]:SC0[0]:HE1:SE1] takes:
&gt;  (&amp;tp-&gt;lock){+...}, at: [&lt;de8706e0&gt;] rtl8139_interrupt+0x27/0x46b [8139too]
&gt; {in-hardirq-W} state was registered at:
&gt;   [&lt;c0138eeb&gt;] __lock_acquire+0x949/0x11ac
&gt;   [&lt;c01397e7&gt;] lock_acquire+0x99/0xb2
&gt;   [&lt;c0452ff3&gt;] _spin_lock+0x35/0x42
&gt;   [&lt;de8706e0&gt;] rtl8139_interrupt+0x27/0x46b [8139too]
&gt;   [&lt;c0147a5d&gt;] handle_IRQ_event+0x28/0x59
&gt;   [&lt;c01493ca&gt;] handle_level_irq+0xad/0x10b
&gt;   [&lt;c0105a13&gt;] do_IRQ+0x93/0xd0
&gt;   [&lt;c010441e&gt;] common_interrupt+0x2e/0x34
...
&gt; other info that might help us debug this:
&gt; 1 lock held by ifconfig/5492:
&gt;  #0:  (rtnl_mutex){--..}, at: [&lt;c0451778&gt;] mutex_lock+0x1c/0x1f
&gt;
&gt; stack backtrace:
...
&gt;  [&lt;c0452ff3&gt;] _spin_lock+0x35/0x42
&gt;  [&lt;de8706e0&gt;] rtl8139_interrupt+0x27/0x46b [8139too]
&gt;  [&lt;c01480fd&gt;] free_irq+0x11b/0x146
&gt;  [&lt;de871d59&gt;] rtl8139_close+0x8a/0x14a [8139too]
&gt;  [&lt;c03bde63&gt;] dev_close+0x57/0x74
...

This shows that a driver's irq handler was running both in hard interrupt
and process contexts with irqs enabled. The latter was done during
free_irq() call and was possible only with CONFIG_DEBUG_SHIRQ enabled.
This was fixed by another patch.

But similar problem is possible with request_irq(): any locks taken from
irq handler could be vulnerable - especially with soft interrupts. This
patch fixes it by disabling local interrupts during handler's run. (It
seems, disabling softirqs should be enough, but it needs more checking
on possible races or other special cases).

Reported-by: Mariusz Kozlowski &lt;m.kozlowski@tuxland.pl&gt;
Signed-off-by: Jarek Poplawski &lt;jarkao2@o2.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>free_irq(): fix DEBUG_SHIRQ handling</title>
<updated>2007-08-23T02:52:44Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2007-08-22T21:01:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8b7f07155f8ee1536da2f9590f1aa9383afefb6b'/>
<id>urn:sha1:8b7f07155f8ee1536da2f9590f1aa9383afefb6b</id>
<content type='text'>
If we're going to run the handler from free_irq() then we must do it with
local irq's disabled.  Otherwise lockdep complains that the handler is taking
irq-safe spinlocks in a non-irq-safe fashion.

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>genirq: suppress resend of level interrupts</title>
<updated>2007-08-12T18:05:45Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-08-12T15:46:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2464286ace55b3abddfb9cc30ab95e2dac1de9a6'/>
<id>urn:sha1:2464286ace55b3abddfb9cc30ab95e2dac1de9a6</id>
<content type='text'>
Level type interrupts are resent by the interrupt hardware when they are
still active at irq_enable().

Suppress the resend mechanism for interrupts marked as level.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>genirq: cleanup mismerge artifact</title>
<updated>2007-08-12T18:05:45Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-08-12T15:46:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=496634217e5671ed876a0348e9f5b7165e830b20'/>
<id>urn:sha1:496634217e5671ed876a0348e9f5b7165e830b20</id>
<content type='text'>
Commit 5a43a066b11ac2fe84cf67307f20b83bea390f83: "genirq: Allow fasteoi
handler to retrigger disabled interrupts" was erroneously applied to
handle_level_irq().  This added the irq retrigger / resend functionality
to the level irq handler.

Revert the offending bits.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "genirq: temporary fix for level-triggered IRQ resend"</title>
<updated>2007-08-09T15:10:16Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@woody.linux-foundation.org</email>
</author>
<published>2007-08-09T15:10:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88ffc3505988196ef5cfdc0278ad89025c2a7b1a'/>
<id>urn:sha1:88ffc3505988196ef5cfdc0278ad89025c2a7b1a</id>
<content type='text'>
This reverts commit 0fc4969b866671dfe39b1a9119d0fdc7ea0f63e5.  It was
always meant to be temporary, but it's generating more useless noise
than anything else, and we probably should never have done it in the
generic kernel (only had the people involved test it on their own).

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
