<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/irq/manage.c, branch linux-2.6.31.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-08-18T15:22:43Z</updated>
<entry>
<title>genirq: Wake up irq thread after action has been installed</title>
<updated>2009-08-18T15:22:43Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2009-08-17T12:07:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69ab849439b506cd8dd2879527fdb64d95dd5211'/>
<id>urn:sha1:69ab849439b506cd8dd2879527fdb64d95dd5211</id>
<content type='text'>
The wake_up_process() of the new irq thread in __setup_irq() is too
early as the irqaction is not yet fully initialized especially
action-&gt;irq is not yet set. The interrupt thread might dereference the
wrong irq descriptor.

Move the wakeup after the action is installed and action-&gt;irq has been
set.

Reported-by: Michael Buesch &lt;mb@bu3sch.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Buesch &lt;mb@bu3sch.de&gt;
</content>
</entry>
<entry>
<title>genirq: prevent wakeup of freed irq thread</title>
<updated>2009-08-13T21:09:27Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2009-08-13T20:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2d860ad76f4ee4d2eba0fe3797c8d7cdce432cc0'/>
<id>urn:sha1:2d860ad76f4ee4d2eba0fe3797c8d7cdce432cc0</id>
<content type='text'>
free_irq() can remove an irqaction while the corresponding interrupt
is in progress, but free_irq() sets action-&gt;thread to NULL
unconditionally, which might lead to a NULL pointer dereference in
handle_IRQ_event() when the hard interrupt context tries to wake up
the handler thread.

Prevent this by moving the thread stop after synchronize_irq(). No
need to set action-&gt;thread to NULL either as action is going to be
freed anyway.

This fixes a boot crash reported against preempt-rt which uses the
mainline irq threads code to implement full irq threading.

[ tglx: removed local irqthread variable ]

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>genirq: Fix UP compile failure caused by irq_thread_check_affinity</title>
<updated>2009-07-22T21:18:46Z</updated>
<author>
<name>Bruno Premont</name>
</author>
<published>2009-07-22T20:22:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61f3826133dc07142935fb5712fc738e19eb5575'/>
<id>urn:sha1:61f3826133dc07142935fb5712fc738e19eb5575</id>
<content type='text'>
Since genirq: Delegate irq affinity setting to the irq thread
(591d2fb02ea80472d846c0b8507007806bdd69cc) compilation with
CONFIG_SMP=n fails with following error:

/usr/src/linux-2.6/kernel/irq/manage.c:
   In function 'irq_thread_check_affinity':
/usr/src/linux-2.6/kernel/irq/manage.c:475:
   error: 'struct irq_desc' has no member named 'affinity'
make[4]: *** [kernel/irq/manage.o] Error 1

That commit adds a new function irq_thread_check_affinity() which
uses struct irq_desc.affinity which is only available for CONFIG_SMP=y.
Move that function under #ifdef CONFIG_SMP.

[ tglx@brownpaperbag: compile and boot tested on UP and SMP ]

Signed-off-by: Bruno Premont &lt;bonbons@linux-vserver.org&gt;
LKML-Reference: &lt;20090722222232.2eb3e1c4@neptune.home&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>genirq: Delegate irq affinity setting to the irq thread</title>
<updated>2009-07-21T12:35:07Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2009-07-21T09:09:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=591d2fb02ea80472d846c0b8507007806bdd69cc'/>
<id>urn:sha1:591d2fb02ea80472d846c0b8507007806bdd69cc</id>
<content type='text'>
irq_set_thread_affinity() calls set_cpus_allowed_ptr() which might
sleep, but irq_set_thread_affinity() is called with desc-&gt;lock held
and can be called from hard interrupt context as well. The code has
another bug as it does not hold a ref on the task struct as required
by set_cpus_allowed_ptr().

Just set the IRQTF_AFFINITY bit in action-&gt;thread_flags. The next time
the thread runs it migrates itself. Solves all of the above problems
nicely.

Add kerneldoc to irq_set_thread_affinity() while at it.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
LKML-Reference: &lt;new-submission&gt;

</content>
</entry>
<entry>
<title>Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-06-20T18:30:01Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2009-06-20T18:30:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2453d6ff6ffc5f0d496b7b14f509a26f99bf115e'/>
<id>urn:sha1:2453d6ff6ffc5f0d496b7b14f509a26f99bf115e</id>
<content type='text'>
* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq, irq.h: Fix kernel-doc warnings
  genirq: fix comment to say IRQ_WAKE_THREAD
</content>
</entry>
<entry>
<title>genirq: fix comment to say IRQ_WAKE_THREAD</title>
<updated>2009-05-12T20:11:29Z</updated>
<author>
<name>Steven Rostedt</name>
</author>
<published>2009-05-12T18:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39a2eddb9b62959dc55c6978b5eaeb3dd57c5ff2'/>
<id>urn:sha1:39a2eddb9b62959dc55c6978b5eaeb3dd57c5ff2</id>
<content type='text'>
Trying to implement a driver to use threaded irqs, I was confused when the 
return value to use that was described in the comment above 
request_threaded_irq was not defined.

Turns out that the enum is IRQ_WAKE_THREAD where as the comment said 
IRQ_THREAD_WAKE.

[Impact: do not confuse developers with wrong comments ]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;alpine.DEB.2.00.0905121431020.13338@gandalf.stny.rr.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>irq: only update affinity if -&gt;set_affinity() is sucessfull</title>
<updated>2009-04-28T10:21:16Z</updated>
<author>
<name>Yinghai Lu</name>
</author>
<published>2009-04-28T00:59:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=57b150cce8e004ddd36330490a68bfb59b7271e9'/>
<id>urn:sha1:57b150cce8e004ddd36330490a68bfb59b7271e9</id>
<content type='text'>
irq_set_affinity() and move_masked_irq() try to assign affinity
before calling chip set_affinity(). Some archs are assigning it
in -&gt;set_affinity() again.

We do something like:

 cpumask_cpy(desc-&gt;affinity, mask);
 desc-&gt;chip-&gt;set_affinity(mask);

But in the failure path, affinity should not be touched - otherwise
we'll end up with a different affinity mask despite the failure to
migrate the IRQ.

So try to update the afffinity only if set_affinity returns with 0.
Also call irq_set_thread_affinity accordingly.

v2: update after "irq, x86: Remove IRQ_DISABLED check in process context IRQ move"
v3: according to Ingo, change set_affinity() in irq_chip should return int.
v4: update comments by removing moving irq_desc code.

[ Impact: fix /proc/irq/*/smp_affinity setting corner case bug ]

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
LKML-Reference: &lt;49F65509.60307@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86, irq: Remove IRQ_DISABLED check in process context IRQ move</title>
<updated>2009-04-14T13:21:13Z</updated>
<author>
<name>Pallipadi, Venkatesh</name>
</author>
<published>2009-04-13T22:20:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ec3cfeca04622e3d80c9270191cd7f5f88214af'/>
<id>urn:sha1:6ec3cfeca04622e3d80c9270191cd7f5f88214af</id>
<content type='text'>
As discussed in the thread here:

  http://marc.info/?l=linux-kernel&amp;m=123964468521142&amp;w=2

Eric W. Biederman observed:

&gt; It looks like some additional bugs have slipped in since last I looked.
&gt;
&gt; set_irq_affinity does this:
&gt; ifdef CONFIG_GENERIC_PENDING_IRQ
&gt;        if (desc-&gt;status &amp; IRQ_MOVE_PCNTXT || desc-&gt;status &amp; IRQ_DISABLED) {
&gt;                cpumask_copy(desc-&gt;affinity, cpumask);
&gt;                desc-&gt;chip-&gt;set_affinity(irq, cpumask);
&gt;        } else {
&gt;                desc-&gt;status |= IRQ_MOVE_PENDING;
&gt;                cpumask_copy(desc-&gt;pending_mask, cpumask);
&gt;        }
&gt; #else
&gt;
&gt; That IRQ_DISABLED case is a software state and as such it has nothing to
&gt; do with how safe it is to move an irq in process context.

[...]

&gt;
&gt; The only reason we migrate MSIs in interrupt context today is that there
&gt; wasn't infrastructure for support migration both in interrupt context
&gt; and outside of it.

Yes. The idea here was to force the MSI migration to happen in process
context. One of the patches in the series did

        disable_irq(dev-&gt;irq);
        irq_set_affinity(dev-&gt;irq, cpumask_of(dev-&gt;cpu));
        enable_irq(dev-&gt;irq);

with the above patch adding irq/manage code check for interrupt disabled
and moving the interrupt in process context.

IIRC, there was no IRQ_MOVE_PCNTXT when we were developing this HPET
code and we ended up having this ugly hack. IRQ_MOVE_PCNTXT was there
when we eventually submitted the patch upstream. But, looks like I did a
blind rebasing instead of using IRQ_MOVE_PCNTXT in hpet MSI code.

Below patch fixes this. i.e., revert commit 932775a4ab622e3c99bd59f14cc
and add PCNTXT to HPET MSI setup. Also removes copying of desc-&gt;affinity
in generic code as set_affinity routines are doing it internally.

Reported-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Venkatesh Pallipadi &lt;venkatesh.pallipadi@intel.com&gt;
Acked-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: "Li Shaohua" &lt;shaohua.li@intel.com&gt;
Cc: Gary Hade &lt;garyhade@us.ibm.com&gt;
Cc: "lcm@us.ibm.com" &lt;lcm@us.ibm.com&gt;
Cc: suresh.b.siddha@intel.com
LKML-Reference: &lt;20090413222058.GB8211@linux-os.sc.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linus' into irq/threaded</title>
<updated>2009-04-05T23:41:22Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2009-04-05T23:41:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9efe21cb82b5dbe3b0b2ae4de4eccc64ecb94e95'/>
<id>urn:sha1:9efe21cb82b5dbe3b0b2ae4de4eccc64ecb94e95</id>
<content type='text'>
Conflicts:
	include/linux/irq.h
	kernel/irq/handle.c
</content>
</entry>
<entry>
<title>PM: Introduce functions for suspending and resuming device interrupts</title>
<updated>2009-03-30T19:46:54Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2009-03-16T21:33:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a0c5168df270a50e3518e4f12bddb31f8f5f38f'/>
<id>urn:sha1:0a0c5168df270a50e3518e4f12bddb31f8f5f38f</id>
<content type='text'>
Introduce helper functions allowing us to prevent device drivers from
getting any interrupts (without disabling interrupts on the CPU)
during suspend (or hibernation) and to make them start to receive
interrupts again during the subsequent resume.  These functions make it
possible to keep timer interrupts enabled while the "late" suspend and
"early" resume callbacks provided by device drivers are being
executed.  In turn, this allows device drivers' "late" suspend and
"early" resume callbacks to sleep, execute ACPI callbacks etc.

The functions introduced here will be used to rework the handling of
interrupts during suspend (hibernation) and resume.  Namely,
interrupts will only be disabled on the CPU right before suspending
sysdevs, while device drivers will be prevented from receiving
interrupts, with the help of the new helper function, before their
"late" suspend callbacks run (and analogously during resume).

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
