<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/irq, branch v2.6.19</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.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2006-11-22T17:32:06Z</updated>
<entry>
<title>Don't call "note_interrupt()" with irq descriptor lock held</title>
<updated>2006-11-22T17:32:06Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@woody.osdl.org</email>
</author>
<published>2006-11-22T17:32:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b42172fc7b569a0ef2b0fa38d71382969074c0e2'/>
<id>urn:sha1:b42172fc7b569a0ef2b0fa38d71382969074c0e2</id>
<content type='text'>
This reverts commit f72fa707604c015a6625e80f269506032d5430dc, and solves
the problem that it tried to fix by simply making "__do_IRQ()" call the
note_interrupt() function without the lock held, the way everybody else
does.

It should be noted that all interrupt handling code must never allow the
descriptor actors to be entered "recursively" (that's why we do all the
magic IRQ_PENDING stuff in the first place), so there actually is
exclusion at that much higher level, even in the absense of locking.

Acked-by: Vivek Goyal &lt;vgoyal@in.ibm.com&gt;
Acked-by:Pavel Emelianov &lt;xemul@openvz.org&gt;
Cc: Andrew Morton &lt;akpm@osdl.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] some irq_chip variables point to NULL</title>
<updated>2006-11-16T19:43:37Z</updated>
<author>
<name>Zhang, Yanmin</name>
<email>yanmin_zhang@linux.intel.com</email>
</author>
<published>2006-11-16T09:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b86432b42eba5671969a9e6483ee219674b7ee25'/>
<id>urn:sha1:b86432b42eba5671969a9e6483ee219674b7ee25</id>
<content type='text'>
I got an oops when booting 2.6.19-rc5-mm1 on my ia64 machine.

Below is the log.

Oops 11012296146944 [1]
Modules linked in: binfmt_misc dm_mirror dm_multipath dm_mod thermal processor f
an container button sg eepro100 e100 mii

Pid: 0, CPU 0, comm:              swapper
psr : 0000121008022038 ifs : 800000000000040b ip  : [&lt;a0000001000e1411&gt;]    Not
tainted
ip is at __do_IRQ+0x371/0x3e0
unat: 0000000000000000 pfs : 000000000000040b rsc : 0000000000000003
rnat: 656960155aa56aa5 bsps: a00000010058b890 pr  : 656960155aa55a65
ldrs: 0000000000000000 ccv : 0000000000000000 fpsr: 0009804c0270033f
csd : 0000000000000000 ssd : 0000000000000000
b0  : a0000001000e1390 b6  : a0000001005beac0 b7  : e00000007f01aa00
f6  : 000000000000000000000 f7  : 0ffe69090000000000000
f8  : 1000a9090000000000000 f9  : 0ffff8000000000000000
f10 : 1000a908ffffff6f70000 f11 : 1003e0000000000000909
r1  : a000000100fbbff0 r2  : 0000000000010002 r3  : 0000000000010001
r8  : fffffffffffbffff r9  : a000000100bd8060 r10 : a000000100dd83b8
r11 : fffffffffffeffff r12 : a000000100bcbbb0 r13 : a000000100bc4000
r14 : 0000000000010000 r15 : 0000000000010000 r16 : a000000100c01aa8
r17 : a000000100d2c350 r18 : 0000000000000000 r19 : a000000100d2c300
r20 : a000000100c01a88 r21 : 0000000080010100 r22 : a000000100c01ac0
r23 : a0000001000108e0 r24 : e000000477980004 r25 : 0000000000000000
r26 : 0000000000000000 r27 : e00000000913400c r28 : e0000004799ee51c
r29 : e0000004778b87f0 r30 : a000000100d2c300 r31 : a00000010005c7e0

Call Trace:
 [&lt;a000000100014600&gt;] show_stack+0x40/0xa0
                                sp=a000000100bcb760 bsp=a000000100bc4f40
 [&lt;a000000100014f00&gt;] show_regs+0x840/0x880
                                sp=a000000100bcb930 bsp=a000000100bc4ee8
 [&lt;a000000100037fb0&gt;] die+0x250/0x320
                                sp=a000000100bcb930 bsp=a000000100bc4ea0
 [&lt;a00000010005e5f0&gt;] ia64_do_page_fault+0x8d0/0xa20
                                sp=a000000100bcb950 bsp=a000000100bc4e50
 [&lt;a00000010000caa0&gt;] ia64_leave_kernel+0x0/0x290
                                sp=a000000100bcb9e0 bsp=a000000100bc4e50
 [&lt;a0000001000e1410&gt;] __do_IRQ+0x370/0x3e0
                                sp=a000000100bcbbb0 bsp=a000000100bc4df0
 [&lt;a000000100011f50&gt;] ia64_handle_irq+0x170/0x220
                                sp=a000000100bcbbb0 bsp=a000000100bc4dc0
 [&lt;a00000010000caa0&gt;] ia64_leave_kernel+0x0/0x290
                                sp=a000000100bcbbb0 bsp=a000000100bc4dc0
 [&lt;a000000100012390&gt;] ia64_pal_call_static+0x90/0xc0
                                sp=a000000100bcbd80 bsp=a000000100bc4d78
 [&lt;a000000100015630&gt;] default_idle+0x90/0x160
                                sp=a000000100bcbd80 bsp=a000000100bc4d58
 [&lt;a000000100014290&gt;] cpu_idle+0x1f0/0x440
                                sp=a000000100bcbe20 bsp=a000000100bc4d18
 [&lt;a000000100009980&gt;] rest_init+0xc0/0xe0
                                sp=a000000100bcbe20 bsp=a000000100bc4d00
 [&lt;a0000001009f8ea0&gt;] start_kernel+0x6a0/0x6c0
                                sp=a000000100bcbe20 bsp=a000000100bc4ca0
 [&lt;a0000001000089f0&gt;] __end_ivt_text+0x6d0/0x6f0
                                sp=a000000100bcbe30 bsp=a000000100bc4c00
 &lt;0&gt;Kernel panic - not syncing: Aiee, killing interrupt handler!

The root cause is that some irq_chip variables, especially ia64_msi_chip,
initiate their memeber end to point to NULL. __do_IRQ doesn't check
if irq_chip-&gt;end is null and just calls it after processing the interrupt.

As irq_chip-&gt;end is called at many places, so I fix it by reinitiating
irq_chip-&gt;end to dummy_irq_chip.end, e.g., a noop function.

Signed-off-by: Zhang Yanmin &lt;yanmin.zhang@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: "Luck, Tony" &lt;tony.luck@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] setup_irq(): better mismatch debugging</title>
<updated>2006-11-14T17:09:26Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2006-11-14T10:03:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8b126b77536186eef69d408eb7959ce7f558f251'/>
<id>urn:sha1:8b126b77536186eef69d408eb7959ce7f558f251</id>
<content type='text'>
When we get a mismatch between handlers on the same IRQ, all we get is "IRQ
handler type mismatch for IRQ n".  Let's print the name of the
presently-registered handler with which we got the mismatch.

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Fix misrouted interrupts deadlocks</title>
<updated>2006-11-13T15:40:43Z</updated>
<author>
<name>Pavel Emelianov</name>
<email>xemul@openvz.org</email>
</author>
<published>2006-11-10T20:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f72fa707604c015a6625e80f269506032d5430dc'/>
<id>urn:sha1:f72fa707604c015a6625e80f269506032d5430dc</id>
<content type='text'>
While testing kernel on machine with "irqpoll" option I've caught such a
lockup:

	__do_IRQ()
	   spin_lock(&amp;desc-&gt;lock);
           desc-&gt;chip-&gt;ack(); /* IRQ is ACKed */
	note_interrupt()
	misrouted_irq()
	handle_IRQ_event()
           if (...)
	      local_irq_enable_in_hardirq();
	/* interrupts are enabled from now */
	...
	__do_IRQ() /* same IRQ we've started from */
	   spin_lock(&amp;desc-&gt;lock); /* LOCKUP */

Looking at misrouted_irq() code I've found that a potential deadlock like
this can also take place:

1CPU:
__do_IRQ()
   spin_lock(&amp;desc-&gt;lock); /* irq = A */
misrouted_irq()
   for (i = 1; i &lt; NR_IRQS; i++) {
      spin_lock(&amp;desc-&gt;lock); /* irq = B */
      if (desc-&gt;status &amp; IRQ_INPROGRESS) {

2CPU:
__do_IRQ()
   spin_lock(&amp;desc-&gt;lock); /* irq = B */
misrouted_irq()
   for (i = 1; i &lt; NR_IRQS; i++) {
      spin_lock(&amp;desc-&gt;lock); /* irq = A */
      if (desc-&gt;status &amp; IRQ_INPROGRESS) {

As the second lock on both CPUs is taken before checking that this irq is
being handled in another processor this may cause a deadlock.  This issue
is only theoretical.

I propose the attached patch to fix booth problems: when trying to handle
misrouted IRQ active desc-&gt;lock may be unlocked.

Acked-by: Ingo Molnar &lt;mingo@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] genirq: clean up irq-flow-type naming</title>
<updated>2006-10-17T15:18:45Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2006-10-17T07:10:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a460e745e8f9c75a0525ff94154a0629f9d3e05d'/>
<id>urn:sha1:a460e745e8f9c75a0525ff94154a0629f9d3e05d</id>
<content type='text'>
Introduce desc-&gt;name and eliminate the handle_irq_name() hack.  Add
set_irq_chip_and_handler_name() to set the flow type and name at once.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Matthew Wilcox &lt;willy@debian.org&gt;
Cc: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] bitmap: parse input from kernel and user buffers</title>
<updated>2006-10-11T18:14:22Z</updated>
<author>
<name>Reinette Chatre</name>
<email>reinette.chatre@linux.intel.com</email>
</author>
<published>2006-10-11T08:21:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=01a3ee2b203e511e20f98b85a9172fd32c53e87c'/>
<id>urn:sha1:01a3ee2b203e511e20f98b85a9172fd32c53e87c</id>
<content type='text'>
lib/bitmap.c:bitmap_parse() is a library function that received as input a
user buffer.  This seemed to have originated from the way the write_proc
function of the /proc filesystem operates.

This has been reworked to not use kmalloc and eliminates a lot of
get_user() overhead by performing one access_ok before using __get_user().

We need to test if we are in kernel or user space (is_user) and access the
buffer differently.  We cannot use __get_user() to access kernel addresses
in all cases, for example in architectures with separate address space for
kernel and user.

This function will be useful for other uses as well; for example, taking
input for /sysfs instead of /proc, so it was changed to accept kernel
buffers.  We have this use for the Linux UWB project, as part as the
upcoming bandwidth allocator code.

Only a few routines used this function and they were changed too.

Signed-off-by: Reinette Chatre &lt;reinette.chatre@linux.intel.com&gt;
Signed-off-by: Inaky Perez-Gonzalez &lt;inaky@linux.intel.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: Joe Korty &lt;joe.korty@ccur.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] ixp4xxdefconfig arm fixes</title>
<updated>2006-10-06T19:11:08Z</updated>
<author>
<name>Frederik Deweerdt</name>
<email>deweerdt@free.fr</email>
</author>
<published>2006-10-06T18:58:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e317c8ccaaf900abf39cc3240e4dc5ba82a3cc67'/>
<id>urn:sha1:e317c8ccaaf900abf39cc3240e4dc5ba82a3cc67</id>
<content type='text'>
With the following patch, the ixp4xxdefconfig builds correctly.  I'll
test some more configs if I get some time.

Signed-off-by: Frederik Deweerdt &lt;frederik.deweerdt@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>IRQ: Maintain regs pointer globally rather than passing to IRQ handlers</title>
<updated>2006-10-05T14:10:12Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-10-05T13:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d12e780e003f93433d49ce78cfedf4b4c52adc5'/>
<id>urn:sha1:7d12e780e003f93433d49ce78cfedf4b4c52adc5</id>
<content type='text'>
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
</content>
</entry>
<entry>
<title>IRQ: Typedef the IRQ handler function type</title>
<updated>2006-10-05T12:28:27Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-10-05T12:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=da482792a6d1a3fbaaa25fae867b343fb4db3246'/>
<id>urn:sha1:da482792a6d1a3fbaaa25fae867b343fb4db3246</id>
<content type='text'>
Typedef the IRQ handler function type.

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
(cherry picked from 1356d1e5fd256997e3d3dce0777ab787d0515c7a commit)
</content>
</entry>
<entry>
<title>IRQ: Typedef the IRQ flow handler function type</title>
<updated>2006-10-05T12:28:06Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-10-05T12:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=57a58a9435aef3e0342ba4b2c97e0ddfea6f2c7f'/>
<id>urn:sha1:57a58a9435aef3e0342ba4b2c97e0ddfea6f2c7f</id>
<content type='text'>
Typedef the IRQ flow handler function type.

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
(cherry picked from 8e973fbdf5716b93a0a8c0365be33a31ca0fa351 commit)
</content>
</entry>
</feed>
