<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/irq, branch v3.4.96</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/irq?h=v3.4.96</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/irq?h=v3.4.96'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-07-01T03:01:33Z</updated>
<entry>
<title>genirq: Sanitize spurious interrupt detection of threaded irqs</title>
<updated>2014-07-01T03:01:33Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-03-07T13:53:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a97df3f22b83742deb9191d53928641ec3befb6e'/>
<id>urn:sha1:a97df3f22b83742deb9191d53928641ec3befb6e</id>
<content type='text'>
commit 1e77d0a1ed7417d2a5a52a7b8d32aea1833faa6c upstream.

Till reported that the spurious interrupt detection of threaded
interrupts is broken in two ways:

- note_interrupt() is called for each action thread of a shared
  interrupt line. That's wrong as we are only interested whether none
  of the device drivers felt responsible for the interrupt, but by
  calling multiple times for a single interrupt line we account
  IRQ_NONE even if one of the drivers felt responsible.

- note_interrupt() when called from the thread handler is not
  serialized. That leaves the members of irq_desc which are used for
  the spurious detection unprotected.

To solve this we need to defer the spurious detection of a threaded
interrupt to the next hardware interrupt context where we have
implicit serialization.

If note_interrupt is called with action_ret == IRQ_WAKE_THREAD, we
check whether the previous interrupt requested a deferred check. If
not, we request a deferred check for the next hardware interrupt and
return.

If set, we check whether one of the interrupt threads signaled
success. Depending on this information we feed the result into the
spurious detector.

If one primary handler of a shared interrupt returns IRQ_HANDLED we
disable the deferred check of irq threads on the same line, as we have
found at least one device driver who cared.

Reported-by: Till Straumann &lt;strauman@slac.stanford.edu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Austin Schuh &lt;austin@peloton-tech.com&gt;
Cc: Oliver Hartkopp &lt;socketcan@hartkopp.net&gt;
Cc: Wolfgang Grandegger &lt;wg@grandegger.com&gt;
Cc: Pavel Pisa &lt;pisa@cmp.felk.cvut.cz&gt;
Cc: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Cc: linux-can@vger.kernel.org
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1303071450130.22263@ionos
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>genirq: Remove racy waitqueue_active check</title>
<updated>2014-03-24T04:37:05Z</updated>
<author>
<name>Chuansheng Liu</name>
<email>chuansheng.liu@intel.com</email>
</author>
<published>2014-02-24T03:29:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b46741f24d1c0d0d8dcfb3c63439338d2dc0337e'/>
<id>urn:sha1:b46741f24d1c0d0d8dcfb3c63439338d2dc0337e</id>
<content type='text'>
commit c685689fd24d310343ac33942e9a54a974ae9c43 upstream.

We hit one rare case below:

T1 calling disable_irq(), but hanging at synchronize_irq()
always;
The corresponding irq thread is in sleeping state;
And all CPUs are in idle state;

After analysis, we found there is one possible scenerio which
causes T1 is waiting there forever:
CPU0                                       CPU1
 synchronize_irq()
  wait_event()
    spin_lock()
                                           atomic_dec_and_test(&amp;threads_active)
      insert the __wait into queue
    spin_unlock()
                                           if(waitqueue_active)
    atomic_read(&amp;threads_active)
                                             wake_up()

Here after inserted the __wait into queue on CPU0, and before
test if queue is empty on CPU1, there is no barrier, it maybe
cause it is not visible for CPU1 immediately, although CPU0 has
updated the queue list.
It is similar for CPU0 atomic_read() threads_active also.

So we'd need one smp_mb() before waitqueue_active.that, but removing
the waitqueue_active() check solves it as wel l and it makes
things simple and clear.

Signed-off-by: Chuansheng Liu &lt;chuansheng.liu@intel.com&gt;
Cc: Xiaoming Wang &lt;xiaoming.wang@intel.com&gt;
Link: http://lkml.kernel.org/r/1393212590-32543-1-git-send-email-chuansheng.liu@intel.com
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: Add missing irq_to_desc export for CONFIG_SPARSE_IRQ=n</title>
<updated>2014-02-22T18:32:46Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2014-02-10T18:39:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=df1cc7da2a599bde8f28f94601b7ec4c85ec441b'/>
<id>urn:sha1:df1cc7da2a599bde8f28f94601b7ec4c85ec441b</id>
<content type='text'>
commit 2c45aada341121438affc4cb8d5b4cfaa2813d3d upstream.

In allmodconfig builds for sparc and any other arch which does
not set CONFIG_SPARSE_IRQ, the following will be seen at modpost:

  CC [M]  lib/cpu-notifier-error-inject.o
  CC [M]  lib/pm-notifier-error-inject.o
ERROR: "irq_to_desc" [drivers/gpio/gpio-mcp23s08.ko] undefined!
make[2]: *** [__modpost] Error 1

This happens because commit 3911ff30f5 ("genirq: export
handle_edge_irq() and irq_to_desc()") added one export for it, but
there were actually two instances of it, in an if/else clause for
CONFIG_SPARSE_IRQ.  Add the second one.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Link: http://lkml.kernel.org/r/1392057610-11514-1-git-send-email-paul.gortmaker@windriver.com
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>irq: Enable all irqs unconditionally in irq_resume</title>
<updated>2013-12-12T06:34:11Z</updated>
<author>
<name>Laxman Dewangan</name>
<email>ldewangan@nvidia.com</email>
</author>
<published>2013-11-25T14:09:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a8000959881be86ee8e5262d305f12accb68db70'/>
<id>urn:sha1:a8000959881be86ee8e5262d305f12accb68db70</id>
<content type='text'>
commit ac01810c9d2814238f08a227062e66a35a0e1ea2 upstream.

When the system enters suspend, it disables all interrupts in
suspend_device_irqs(), including the interrupts marked EARLY_RESUME.

On the resume side things are different. The EARLY_RESUME interrupts
are reenabled in sys_core_ops-&gt;resume and the non EARLY_RESUME
interrupts are reenabled in the normal system resume path.

When suspend_noirq() failed or suspend is aborted for any other
reason, we might omit the resume side call to sys_core_ops-&gt;resume()
and therefor the interrupts marked EARLY_RESUME are not reenabled and
stay disabled forever.

To solve this, enable all irqs unconditionally in irq_resume()
regardless whether interrupts marked EARLY_RESUMEhave been already
enabled or not.

This might try to reenable already enabled interrupts in the non
failure case, but the only affected platform is XEN and it has been
confirmed that it does not cause any side effects.

[ tglx: Massaged changelog. ]

Signed-off-by: Laxman Dewangan &lt;ldewangan@nvidia.com&gt;
Acked-by-and-tested-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Reviewed-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: &lt;ian.campbell@citrix.com&gt;
Cc: &lt;rjw@rjwysocki.net&gt;
Cc: &lt;len.brown@intel.com&gt;
Cc: &lt;gregkh@linuxfoundation.org&gt;
Link: http://lkml.kernel.org/r/1385388587-16442-1-git-send-email-ldewangan@nvidia.com
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: Fix can_request_irq() for IRQs without an action</title>
<updated>2013-07-22T01:19:01Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2013-06-28T01:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f95bc0f79df33f63a1615d18c92abf829208e2a2'/>
<id>urn:sha1:f95bc0f79df33f63a1615d18c92abf829208e2a2</id>
<content type='text'>
commit 2779db8d37d4b542d9ca2575f5f178dbeaca6c86 upstream.

Commit 02725e7471b8 ('genirq: Use irq_get/put functions'),
inadvertently changed can_request_irq() to return 0 for IRQs that have
no action.  This causes pcibios_lookup_irq() to select only IRQs that
already have an action with IRQF_SHARED set, or to fail if there are
none.  Change can_request_irq() to return 1 for IRQs that have no
action (if the first two conditions are met).

Reported-by: Bjarni Ingi Gislason &lt;bjarniig@rhi.hi.is&gt;
Tested-by: Bjarni Ingi Gislason &lt;bjarniig@rhi.hi.is&gt; (against 3.2)
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: 709647@bugs.debian.org
Link: http://bugs.debian.org/709647
Link: http://lkml.kernel.org/r/1372383630.23847.40.camel@deadeye.wl.decadent.org.uk
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: Avoid deadlock in spurious handling</title>
<updated>2013-02-28T14:58:58Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-11-23T09:08:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b3c57f009cfd9ed81737169c4026bfd03191d993'/>
<id>urn:sha1:b3c57f009cfd9ed81737169c4026bfd03191d993</id>
<content type='text'>
commit e716efde75267eab919cdb2bef5b2cb77f305326 upstream.

commit 52553ddf(genirq: fix regression in irqfixup, irqpoll)
introduced a potential deadlock by calling the action handler with the
irq descriptor lock held.

Remove the call and let the handling code run even for an interrupt
where only a single action is registered. That matches the goal of
the above commit and avoids the deadlock.

Document the confusing action = desc-&gt;action reload in the handling
loop while at it.

Reported-and-tested-by: "Wang, Warner" &lt;warner.wang@hp.com&gt;
Tested-by: Edward Donovan &lt;edward.donovan@numble.net&gt;
Cc: "Wang, Song-Bo (Stoney)" &lt;song-bo.wang@hp.com&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: Always force thread affinity</title>
<updated>2013-01-11T17:06:56Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-11-03T10:52:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=09c4161c8a1fe8900561029a5d1dce8887231afd'/>
<id>urn:sha1:09c4161c8a1fe8900561029a5d1dce8887231afd</id>
<content type='text'>
commit 04aa530ec04f61875b99c12721162e2964e3318c upstream.

Sankara reported that the genirq core code fails to adjust the
affinity of an interrupt thread in several cases:

 1) On request/setup_irq() the call to setup_affinity() happens before
    the new action is registered, so the new thread is not notified.

 2) For secondary shared interrupts nothing notifies the new thread to
    change its affinity.

 3) Interrupts which have the IRQ_NO_BALANCE flag set are not moving
    the thread either.

Fix this by setting the thread affinity flag right on thread creation
time. This ensures that under all circumstances the thread moves to
the right place. Requires a check in irq_thread_check_affinity for an
existing affinity mask (CONFIG_CPU_MASK_OFFSTACK=y)

Reported-and-tested-by: Sankara Muthukrishnan &lt;sankara.m@gmail.com&gt;
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1209041738200.2754@ionos
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>random: remove rand_initialize_irq()</title>
<updated>2012-08-15T15:10:29Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-15T00:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=26665db4f7fa71c56eeb9205e79927cfc21e70c4'/>
<id>urn:sha1:26665db4f7fa71c56eeb9205e79927cfc21e70c4</id>
<content type='text'>
commit c5857ccf293968348e5eb4ebedc68074de3dcda6 upstream.

With the new interrupt sampling system, we are no longer using the
timer_rand_state structure in the irq descriptor, so we can stop
initializing it now.

[ Merged in fixes from Sedat to find some last missing references to
  rand_initialize_irq() ]

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Sedat Dilek &lt;sedat.dilek@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>random: make 'add_interrupt_randomness()' do something sane</title>
<updated>2012-08-15T15:10:10Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-02T11:52:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0110bbfbc8ed1b5240a51e8c767c44a856424139'/>
<id>urn:sha1:0110bbfbc8ed1b5240a51e8c767c44a856424139</id>
<content type='text'>
commit 775f4b297b780601e61787b766f306ed3e1d23eb upstream.

We've been moving away from add_interrupt_randomness() for various
reasons: it's too expensive to do on every interrupt, and flooding the
CPU with interrupts could theoretically cause bogus floods of entropy
from a somewhat externally controllable source.

This solves both problems by limiting the actual randomness addition
to just once a second or after 64 interrupts, whicever comes first.
During that time, the interrupt cycle data is buffered up in a per-cpu
pool.  Also, we make sure the the nonblocking pool used by urandom is
initialized before we start feeding the normal input pool.  This
assures that /dev/urandom is returning unpredictable data as soon as
possible.

(Based on an original patch by Linus, but significantly modified by
tytso.)

Tested-by: Eric Wustrow &lt;ewust@umich.edu&gt;
Reported-by: Eric Wustrow &lt;ewust@umich.edu&gt;
Reported-by: Nadia Heninger &lt;nadiah@cs.ucsd.edu&gt;
Reported-by: Zakir Durumeric &lt;zakir@umich.edu&gt;
Reported-by: J. Alex Halderman &lt;jhalderm@umich.edu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>genirq: export handle_edge_irq() and irq_to_desc()</title>
<updated>2012-05-15T15:10:07Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-05-13T10:13:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3911ff30f5d1175e2e67e73244405e3492b35c79'/>
<id>urn:sha1:3911ff30f5d1175e2e67e73244405e3492b35c79</id>
<content type='text'>
Export handle_edge_irq() and irq_to_desc() to modules to allow them to
do things such as

	__irq_set_handler_locked(...., handle_edge_irq);

This fixes

	ERROR: "handle_edge_irq" [drivers/gpio/gpio-pch.ko] undefined!
	ERROR: "irq_to_desc" [drivers/gpio/gpio-pch.ko] undefined!

when gpio-pch is being built as a module.

This was introduced by commit df9541a60af0 ("gpio: pch9: Use proper flow
type handlers") that added

	__irq_set_handler_locked(d-&gt;irq, handle_edge_irq);

but handle_edge_irq() was not exported for modules (and inlined
__irq_set_handler_locked() requires irq_to_desc() exported as well)

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