<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/irq/chip.c, branch v3.0.86</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/irq/chip.c?h=v3.0.86</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/irq/chip.c?h=v3.0.86'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-04-02T16:27:09Z</updated>
<entry>
<title>genirq: Fix long-term regression in genirq irq_set_irq_type() handling</title>
<updated>2012-04-02T16:27:09Z</updated>
<author>
<name>Russell King</name>
<email>linux@arm.linux.org.uk</email>
</author>
<published>2012-03-05T23:07:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3f64d9ec31e71e7ede5f39175ed5c217f24cb5e4'/>
<id>urn:sha1:3f64d9ec31e71e7ede5f39175ed5c217f24cb5e4</id>
<content type='text'>
commit a09b659cd68c10ec6a30cb91ebd2c327fcd5bfe5 upstream.

In 2008, commit 0c5d1eb77a8be ("genirq: record trigger type") modified the
way set_irq_type() handles the 'no trigger' condition.  However, this has
an adverse effect on PCMCIA support on Intel StrongARM and probably PXA
platforms.

PCMCIA has several status signals on the socket which can trigger
interrupts; some of these status signals depend on the card's mode
(whether it is configured in memory or IO mode).  For example, cards have
a 'Ready/IRQ' signal: in memory mode, this provides an indication to
PCMCIA that the card has finished its power up initialization.  In IO
mode, it provides the device interrupt signal.  Other status signals
switch between on-board battery status and loud speaker output.

In classical PCMCIA implementations, where you have a specific socket
controller, the controller provides a method to mask interrupts from the
socket, and importantly ignore any state transitions on the pins which
correspond with interrupts once masked.  This masking prevents unwanted
events caused by the removal and application of socket power being
forwarded.

However, on platforms where there is no socket controller, the PCMCIA
status and interrupt signals are routed to standard edge-triggered GPIOs.
These GPIOs can be configured to interrupt on rising edge, falling edge,
or never.  This is where the problems start.

Edge triggered interrupts are required to record events while disabled via
the usual methods of {free,request,disable,enable}_irq() to prevent
problems with dropped interrupts (eg, the 8390 driver uses disable_irq()
to defer the delivery of interrupts).  As a result, these interfaces can
not be used to implement the desired behaviour.

The side effect of this is that if the 'Ready/IRQ' GPIO is disabled via
disable_irq() on suspend, and enabled via enable_irq() after resume, we
will record the state transitions caused by powering events as valid
interrupts, and foward them to the card driver, which may attempt to
access a card which is not powered up.

This leads delays resume while drivers spin in their interrupt handlers,
and complaints from drivers before they realize what's happened.

Moreover, in the case of the 'Ready/IRQ' signal, this is requested and
freed by the card driver itself; the PCMCIA core has no idea whether the
interrupt is requested, and, therefore, whether a call to disable_irq()
would be valid.  (We tried this around 2.4.17 / 2.5.1 kernel era, and
ended up throwing it out because of this problem.)

Therefore, it was decided back in around 2002 to disable the edge
triggering instead, resulting in all state transitions on the GPIO being
ignored.  That's what we actually need the hardware to do.

The commit above changes this behaviour; it explicitly prevents the 'no
trigger' state being selected.

The reason that request_irq() does not accept the 'no trigger' state is
for compatibility with existing drivers which do not provide their desired
triggering configuration.  The set_irq_type() function is 'new' and not
used by non-trigger aware drivers.

Therefore, revert this change, and restore previously working platforms
back to their former state.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: linux@arm.linux.org.uk
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>genirq: Handle pending irqs in irq_startup()</title>
<updated>2012-03-01T00:34:29Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-02-08T10:57:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fd844dabebb45631b2e99a02ee6601ca136f10bd'/>
<id>urn:sha1:fd844dabebb45631b2e99a02ee6601ca136f10bd</id>
<content type='text'>
commit b4bc724e82e80478cba5fe9825b62e71ddf78757 upstream.

An interrupt might be pending when irq_startup() is called, but the
startup code does not invoke the resend logic. In some cases this
prevents the device from issuing another interrupt which renders the
device non functional.

Call the resend function in irq_startup() to keep things going.

Reported-and-tested-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>genirq: Unmask oneshot irqs when thread was not woken</title>
<updated>2012-03-01T00:34:29Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-02-07T16:58:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b7f0787da3657100fe8fc8b3f0565b0bee341510'/>
<id>urn:sha1:b7f0787da3657100fe8fc8b3f0565b0bee341510</id>
<content type='text'>
commit ac5637611150281f398bb7a47e3fcb69a09e7803 upstream.

When the primary handler of an interrupt which is marked IRQ_ONESHOT
returns IRQ_HANDLED or IRQ_NONE, then the interrupt thread is not
woken and the unmask logic of the interrupt line is never
invoked. This keeps the interrupt masked forever.

This was not noticed as most IRQ_ONESHOT users wake the thread
unconditionally (usually because they cannot access the underlying
device from hard interrupt context). Though this behaviour was nowhere
documented and not necessarily intentional. Some drivers can avoid the
thread wakeup in certain cases and run into the situation where the
interrupt line s kept masked.

Handle it gracefully.

Reported-and-tested-by: Lothar Wassmann &lt;lw@karo-electronics.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>genirq: Make irq_shutdown() symmetric vs. irq_startup again</title>
<updated>2011-10-03T18:40:27Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2011-09-11T11:59:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=79e72e1b97162d5f4d4ac320238b5cc82e97f040'/>
<id>urn:sha1:79e72e1b97162d5f4d4ac320238b5cc82e97f040</id>
<content type='text'>
commit ed585a651681e822089087b426e6ebfb6d3d9873 upstream.

If an irq_chip provides .irq_shutdown(), but neither of .irq_disable() or
.irq_mask(), free_irq() crashes when jumping to NULL.
Fix this by only trying .irq_disable() and .irq_mask() if there's no
.irq_shutdown() provided.

This revives the symmetry with irq_startup(), which tries .irq_startup(),
.irq_enable(), and irq_unmask(), and makes it consistent with the comment for
irq_chip.irq_shutdown() in &lt;linux/irq.h&gt;, which says:

 * @irq_shutdown:	shut down the interrupt (defaults to -&gt;disable if NULL)

This is also how __free_irq() behaved before the big overhaul, cfr. e.g.
3b56f0585fd4c02d047dc406668cb40159b2d340 ("genirq: Remove bogus conditional"),
where the core interrupt code always overrode .irq_shutdown() to
.irq_disable() if .irq_shutdown() was NULL.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: linux-m68k@lists.linux-m68k.org
Link: http://lkml.kernel.org/r/1315742394-16036-2-git-send-email-geert@linux-m68k.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>irq: Export functions to allow modular irq drivers</title>
<updated>2011-05-18T12:59:08Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@cam.ac.uk</email>
</author>
<published>2011-05-18T09:39:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=edf76f8307c350bcb81f0c760118a991b3e62956'/>
<id>urn:sha1:edf76f8307c350bcb81f0c760118a991b3e62956</id>
<content type='text'>
Export handle_simple_irq, irq_modify_status, irq_alloc_descs,
irq_free_descs and generic_handle_irq to allow their usage in
modules. First user is IIO, which wants to be built modular, but needs
to be able to create irq chips, allocate and configure interrupt
descriptors and handle demultiplexing interrupts.

[ tglx: Moved the uninlinig of generic_handle_irq to a separate patch ]

Signed-off-by: Jonathan Cameron &lt;jic23@cam.ac.uk&gt;
Link: http://lkml.kernel.org/r/%3C1305711544-505-1-git-send-email-jic23%40cam.ac.uk%3E
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>genirq: Support per-IRQ thread disabling.</title>
<updated>2011-04-23T13:56:24Z</updated>
<author>
<name>Paul Mundt</name>
<email>lethal@linux-sh.org</email>
</author>
<published>2011-04-06T21:01:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7f1b1244e159a8490d7fb13667c6cb7e1e75046b'/>
<id>urn:sha1:7f1b1244e159a8490d7fb13667c6cb7e1e75046b</id>
<content type='text'>
This adds support for disabling threading on a per-IRQ basis via the IRQ
status instead of the IRQ flow, which is necessary for interrupts that
don't follow the natural IRQ flow channels, such as those that are
virtually created.

The new APIs added are simply:

	irq_set_thread()
	irq_set_nothread()

which follow the rest of the IRQ status routines.

Chained handlers also have IRQ_NOTHREAD set on them automatically, making
the lack of threading explicit rather than implicit. Subsequently, the
nothread flag can be viewed through the standard genirq debugging
facilities.

[ tglx: Fixed cleanup fallout ]

Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
Link: http://lkml.kernel.org/r/%3C20110406210135.GF18426%40linux-sh.org%3E
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>Fix common misspellings</title>
<updated>2011-03-31T14:26:23Z</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@profusion.mobi</email>
</author>
<published>2011-03-31T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>urn:sha1:25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>genirq: fix CONFIG_IRQ_EDGE_EOI_HANDLER build</title>
<updated>2011-03-30T00:04:39Z</updated>
<author>
<name>Stephen Rothwell</name>
<email>sfr@canb.auug.org.au</email>
</author>
<published>2011-03-29T23:55:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ac0e0447be3b7a3dd583193b0230bfe3ddef0442'/>
<id>urn:sha1:ac0e0447be3b7a3dd583193b0230bfe3ddef0442</id>
<content type='text'>
Fixes these errors:

  kernel/irq/chip.c: In function 'handle_edge_eoi_irq':
  kernel/irq/chip.c:517: warning: label 'out_unlock' defined but not used
  kernel/irq/chip.c:503: error: label 'out_eoi' used but not defined

Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>genirq: Remove compat code</title>
<updated>2011-03-29T12:48:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-03-28T11:32:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0c6f8a8b917ad361319c8ace3e9f28e69bfdb4c1'/>
<id>urn:sha1:0c6f8a8b917ad361319c8ace3e9f28e69bfdb4c1</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>genirq; Fix cleanup fallout</title>
<updated>2011-03-28T23:41:22Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-03-28T19:59:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0ef5ca1e1f0de71300142b8f730f26ded6a0c2f3'/>
<id>urn:sha1:0ef5ca1e1f0de71300142b8f730f26ded6a0c2f3</id>
<content type='text'>
I missed the CONFIG_GENERIC_PENDING_IRQ dependency in the affinity
related functions and the IRQ_LEVEL propagation into irq_data
state. Did not pop up on my main test platforms. :(

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
</content>
</entry>
</feed>
