<feed xmlns='http://www.w3.org/2005/Atom'>
<title>litmus-rt.git/kernel/irq, branch master</title>
<subtitle>The LITMUS^RT kernel.</subtitle>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/'/>
<entry>
<title>genirq: devres: Fix testing return value of request_any_context_irq()</title>
<updated>2015-07-21T17:10:05+00:00</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@ingics.com</email>
</author>
<published>2015-05-11T09:02:58+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=25d8f169eee423940158a0ab33ed5dd1dd995cf9'/>
<id>25d8f169eee423940158a0ab33ed5dd1dd995cf9</id>
<content type='text'>
commit 63781394c540dd9e666a6b21d70b64dd52bce76e upstream.

request_any_context_irq() returns a negative value on failure.
It returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED on success.
So fix testing return value of request_any_context_irq().

Also fixup the return value of devm_request_any_context_irq() to make it
consistent with request_any_context_irq().

Fixes: 0668d3065128 ("genirq: Add devm_request_any_context_irq()")
Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Link: http://lkml.kernel.org/r/1431334978.17783.4.camel@ingics.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 63781394c540dd9e666a6b21d70b64dd52bce76e upstream.

request_any_context_irq() returns a negative value on failure.
It returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED on success.
So fix testing return value of request_any_context_irq().

Also fixup the return value of devm_request_any_context_irq() to make it
consistent with request_any_context_irq().

Fixes: 0668d3065128 ("genirq: Add devm_request_any_context_irq()")
Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Link: http://lkml.kernel.org/r/1431334978.17783.4.camel@ingics.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Set IRQCHIP_SKIP_SET_WAKE flag for dummy_irq_chip</title>
<updated>2015-04-24T18:57:06+00:00</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2015-04-15T08:14:11+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=10a50f1ab5f06c9a3ee5ece3ec52e607ed53c79f'/>
<id>10a50f1ab5f06c9a3ee5ece3ec52e607ed53c79f</id>
<content type='text'>
Without this system suspend is broken on systems that have
drivers calling enable/disable_irq_wake() for interrupts based off
the dummy irq hook. (e.g. drivers/gpio/gpio-pcf857x.c)

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Cc: &lt;cw00.choi@samsung.com&gt;
Cc: &lt;balbi@ti.com&gt;
Cc: &lt;tony@atomide.com&gt;
Cc: Gregory Clement &lt;gregory.clement@free-electrons.com&gt;
Link: http://lkml.kernel.org/r/552E1DD3.4040106@ti.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without this system suspend is broken on systems that have
drivers calling enable/disable_irq_wake() for interrupts based off
the dummy irq hook. (e.g. drivers/gpio/gpio-pcf857x.c)

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Cc: &lt;cw00.choi@samsung.com&gt;
Cc: &lt;balbi@ti.com&gt;
Cc: &lt;tony@atomide.com&gt;
Cc: Gregory Clement &lt;gregory.clement@free-electrons.com&gt;
Link: http://lkml.kernel.org/r/552E1DD3.4040106@ti.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'irqchip-core-4.1-3' of git://git.infradead.org/users/jcooper/linux into irq/core</title>
<updated>2015-04-11T09:17:28+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-04-11T09:17:28+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=b7dccbea6b079be01e07921264709f249009b8e8'/>
<id>b7dccbea6b079be01e07921264709f249009b8e8</id>
<content type='text'>
irqchip core change for v4.1 (round 3) from Jason Cooper

 Purge the gic_arch_extn hacks and abuse by using the new stacked domains

   NOTE: Due to the nature of these changes, patches crossing subsystems have
         been kept together in their own branches.

    - tegra
       - Handle the LIC properly

    - omap
       - Convert crossbar to stacked domains
       - kill arm,routable-irqs in GIC binding

    - exynos
       - Convert PMU wakeup to stacked domains

    - shmobile, ux500, zynq (irq_set_wake branch)
       - Switch from abusing gic_arch_extn to using gic_set_irqchip_flags
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
irqchip core change for v4.1 (round 3) from Jason Cooper

 Purge the gic_arch_extn hacks and abuse by using the new stacked domains

   NOTE: Due to the nature of these changes, patches crossing subsystems have
         been kept together in their own branches.

    - tegra
       - Handle the LIC properly

    - omap
       - Convert crossbar to stacked domains
       - kill arm,routable-irqs in GIC binding

    - exynos
       - Convert PMU wakeup to stacked domains

    - shmobile, ux500, zynq (irq_set_wake branch)
       - Switch from abusing gic_arch_extn to using gic_set_irqchip_flags
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Allow the irqchip state of an IRQ to be save/restored</title>
<updated>2015-04-08T21:28:28+00:00</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2015-03-18T11:01:22+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=1b7047edfcfb257f69e306c9afbab150cb987717'/>
<id>1b7047edfcfb257f69e306c9afbab150cb987717</id>
<content type='text'>
There is a number of cases where a kernel subsystem may want to
introspect the state of an interrupt at the irqchip level:

- When a peripheral is shared between virtual machines,
  its interrupt state becomes part of the guest's state,
  and must be switched accordingly. KVM on arm/arm64 requires
  this for its guest-visible timer
- Some GPIO controllers seem to require peeking into the
  interrupt controller they are connected to to report
  their internal state

This seem to be a pattern that is common enough for the core code
to try and support this without too many horrible hacks. Introduce
a pair of accessors (irq_get_irqchip_state/irq_set_irqchip_state)
to retrieve the bits that can be of interest to another subsystem:
pending, active, and masked.

- irq_get_irqchip_state returns the state of the interrupt according
  to a parameter set to IRQCHIP_STATE_PENDING, IRQCHIP_STATE_ACTIVE,
  IRQCHIP_STATE_MASKED or IRQCHIP_STATE_LINE_LEVEL.
- irq_set_irqchip_state similarly sets the state of the interrupt.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Tested-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Abhijeet Dharmapurikar &lt;adharmap@codeaurora.org&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Phong Vo &lt;pvo@apm.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Tin Huynh &lt;tnhuynh@apm.com&gt;
Cc: Y Vo &lt;yvo@apm.com&gt;
Cc: Toan Le &lt;toanle@apm.com&gt;
Cc: Bjorn Andersson &lt;bjorn@kryo.se&gt;
Cc: Jason Cooper &lt;jason@lakedaemon.net&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: http://lkml.kernel.org/r/1426676484-21812-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a number of cases where a kernel subsystem may want to
introspect the state of an interrupt at the irqchip level:

- When a peripheral is shared between virtual machines,
  its interrupt state becomes part of the guest's state,
  and must be switched accordingly. KVM on arm/arm64 requires
  this for its guest-visible timer
- Some GPIO controllers seem to require peeking into the
  interrupt controller they are connected to to report
  their internal state

This seem to be a pattern that is common enough for the core code
to try and support this without too many horrible hacks. Introduce
a pair of accessors (irq_get_irqchip_state/irq_set_irqchip_state)
to retrieve the bits that can be of interest to another subsystem:
pending, active, and masked.

- irq_get_irqchip_state returns the state of the interrupt according
  to a parameter set to IRQCHIP_STATE_PENDING, IRQCHIP_STATE_ACTIVE,
  IRQCHIP_STATE_MASKED or IRQCHIP_STATE_LINE_LEVEL.
- irq_set_irqchip_state similarly sets the state of the interrupt.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Tested-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Abhijeet Dharmapurikar &lt;adharmap@codeaurora.org&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Phong Vo &lt;pvo@apm.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Tin Huynh &lt;tnhuynh@apm.com&gt;
Cc: Y Vo &lt;yvo@apm.com&gt;
Cc: Toan Le &lt;toanle@apm.com&gt;
Cc: Bjorn Andersson &lt;bjorn@kryo.se&gt;
Cc: Jason Cooper &lt;jason@lakedaemon.net&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: http://lkml.kernel.org/r/1426676484-21812-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: MSI: Fix freeing of unallocated MSI</title>
<updated>2015-04-08T21:28:28+00:00</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2015-01-26T19:10:19+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=fe0c52fc003bc046380e52fe6799c96d770770cc'/>
<id>fe0c52fc003bc046380e52fe6799c96d770770cc</id>
<content type='text'>
While debugging an unrelated issue with the GICv3 ITS driver, the
following trace triggered:

WARNING: CPU: 1 PID: 1 at kernel/irq/irqdomain.c:1121 irq_domain_free_irqs+0x160/0x17c()
NULL pointer, cannot free irq
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W      3.19.0-rc6+ #3690
Hardware name: FVP Base (DT)
Call trace:
[&lt;ffffffc000089398&gt;] dump_backtrace+0x0/0x13c
[&lt;ffffffc0000894e4&gt;] show_stack+0x10/0x1c
[&lt;ffffffc00066d134&gt;] dump_stack+0x74/0x94
[&lt;ffffffc0000a92f8&gt;] warn_slowpath_common+0x9c/0xd4
[&lt;ffffffc0000a938c&gt;] warn_slowpath_fmt+0x5c/0x80
[&lt;ffffffc0000ee04c&gt;] irq_domain_free_irqs+0x15c/0x17c
[&lt;ffffffc0000ef918&gt;] msi_domain_free_irqs+0x58/0x74
[&lt;ffffffc000386f58&gt;] free_msi_irqs+0xb4/0x1c0

    // The msi_prepare callback fails here

[&lt;ffffffc0003872c0&gt;] pci_enable_msix+0x25c/0x3d4
[&lt;ffffffc00038746c&gt;] pci_enable_msix_range+0x34/0x80
[&lt;ffffffc0003924ac&gt;] vp_try_to_find_vqs+0xec/0x528
[&lt;ffffffc000392954&gt;] vp_find_vqs+0x6c/0xa8
[&lt;ffffffc0003ee2a8&gt;] init_vq+0x120/0x248
[&lt;ffffffc0003eefb0&gt;] virtblk_probe+0xb0/0x6bc
[&lt;ffffffc00038fc34&gt;] virtio_dev_probe+0x17c/0x214
[&lt;ffffffc0003d4a04&gt;] driver_probe_device+0x7c/0x23c
[&lt;ffffffc0003d4cb0&gt;] __driver_attach+0x98/0xa0
[&lt;ffffffc0003d2c60&gt;] bus_for_each_dev+0x60/0xb4
[&lt;ffffffc0003d455c&gt;] driver_attach+0x1c/0x28
[&lt;ffffffc0003d41b0&gt;] bus_add_driver+0x150/0x208
[&lt;ffffffc0003d54c0&gt;] driver_register+0x64/0x130
[&lt;ffffffc00038f9e8&gt;] register_virtio_driver+0x24/0x68
[&lt;ffffffc00091320c&gt;] init+0x70/0xac
[&lt;ffffffc0000828f0&gt;] do_one_initcall+0x94/0x1d0
[&lt;ffffffc0008e9b00&gt;] kernel_init_freeable+0x144/0x1e4
[&lt;ffffffc00066a434&gt;] kernel_init+0xc/0xd8
---[ end trace f9ee562a77cc7bae ]---

The ITS msi_prepare callback having failed, we end-up trying to
free MSIs that have never been allocated. Oddly enough, the kernel
is pretty upset about it.

It turns out that this behaviour was expected before the MSI domain
was introduced (and dealt with in arch_teardown_msi_irqs).

The obvious fix is to detect this early enough and bail out.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
Link: http://lkml.kernel.org/r/1422299419-6051-1-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While debugging an unrelated issue with the GICv3 ITS driver, the
following trace triggered:

WARNING: CPU: 1 PID: 1 at kernel/irq/irqdomain.c:1121 irq_domain_free_irqs+0x160/0x17c()
NULL pointer, cannot free irq
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W      3.19.0-rc6+ #3690
Hardware name: FVP Base (DT)
Call trace:
[&lt;ffffffc000089398&gt;] dump_backtrace+0x0/0x13c
[&lt;ffffffc0000894e4&gt;] show_stack+0x10/0x1c
[&lt;ffffffc00066d134&gt;] dump_stack+0x74/0x94
[&lt;ffffffc0000a92f8&gt;] warn_slowpath_common+0x9c/0xd4
[&lt;ffffffc0000a938c&gt;] warn_slowpath_fmt+0x5c/0x80
[&lt;ffffffc0000ee04c&gt;] irq_domain_free_irqs+0x15c/0x17c
[&lt;ffffffc0000ef918&gt;] msi_domain_free_irqs+0x58/0x74
[&lt;ffffffc000386f58&gt;] free_msi_irqs+0xb4/0x1c0

    // The msi_prepare callback fails here

[&lt;ffffffc0003872c0&gt;] pci_enable_msix+0x25c/0x3d4
[&lt;ffffffc00038746c&gt;] pci_enable_msix_range+0x34/0x80
[&lt;ffffffc0003924ac&gt;] vp_try_to_find_vqs+0xec/0x528
[&lt;ffffffc000392954&gt;] vp_find_vqs+0x6c/0xa8
[&lt;ffffffc0003ee2a8&gt;] init_vq+0x120/0x248
[&lt;ffffffc0003eefb0&gt;] virtblk_probe+0xb0/0x6bc
[&lt;ffffffc00038fc34&gt;] virtio_dev_probe+0x17c/0x214
[&lt;ffffffc0003d4a04&gt;] driver_probe_device+0x7c/0x23c
[&lt;ffffffc0003d4cb0&gt;] __driver_attach+0x98/0xa0
[&lt;ffffffc0003d2c60&gt;] bus_for_each_dev+0x60/0xb4
[&lt;ffffffc0003d455c&gt;] driver_attach+0x1c/0x28
[&lt;ffffffc0003d41b0&gt;] bus_add_driver+0x150/0x208
[&lt;ffffffc0003d54c0&gt;] driver_register+0x64/0x130
[&lt;ffffffc00038f9e8&gt;] register_virtio_driver+0x24/0x68
[&lt;ffffffc00091320c&gt;] init+0x70/0xac
[&lt;ffffffc0000828f0&gt;] do_one_initcall+0x94/0x1d0
[&lt;ffffffc0008e9b00&gt;] kernel_init_freeable+0x144/0x1e4
[&lt;ffffffc00066a434&gt;] kernel_init+0xc/0xd8
---[ end trace f9ee562a77cc7bae ]---

The ITS msi_prepare callback having failed, we end-up trying to
free MSIs that have never been allocated. Oddly enough, the kernel
is pretty upset about it.

It turns out that this behaviour was expected before the MSI domain
was introduced (and dealt with in arch_teardown_msi_irqs).

The obvious fix is to detect this early enough and bail out.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
Link: http://lkml.kernel.org/r/1422299419-6051-1-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'linus' into irq/core to get the GIC updates which</title>
<updated>2015-04-08T21:26:21+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-04-08T21:26:21+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=462b69b1e43ceccab68a47d65b1e46520cd0fdc0'/>
<id>462b69b1e43ceccab68a47d65b1e46520cd0fdc0</id>
<content type='text'>
conflict with pending GIC changes.

Conflicts:
	drivers/usb/isp1760/isp1760-core.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
conflict with pending GIC changes.

Conflicts:
	drivers/usb/isp1760/isp1760-core.c
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Add irqchip_set_wake_parent</title>
<updated>2015-03-15T00:55:01+00:00</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2015-03-11T15:43:43+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=08b55e2a9208e4841a17c9d9c2c454986392977d'/>
<id>08b55e2a9208e4841a17c9d9c2c454986392977d</id>
<content type='text'>
This proves to be useful with stacked domains, when the current
domain doesn't implement wake-up, but expect the parent to do so.

Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Link: https://lkml.kernel.org/r/1426088629-15377-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper &lt;jason@lakedaemon.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This proves to be useful with stacked domains, when the current
domain doesn't implement wake-up, but expect the parent to do so.

Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Link: https://lkml.kernel.org/r/1426088629-15377-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper &lt;jason@lakedaemon.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'v4.0-rc2' into irq/core, to refresh the tree before applying new changes</title>
<updated>2015-03-05T19:52:18+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2015-03-05T19:52:18+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=33ca8a53f262b4af40611bea331b8c87d133af72'/>
<id>33ca8a53f262b4af40611bea331b8c87d133af72</id>
<content type='text'>
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq / PM: Add flag for shared NO_SUSPEND interrupt lines</title>
<updated>2015-03-04T20:42:19+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2015-02-26T23:07:55+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=17f480342026e54000731acaa69bf32787ce46cb'/>
<id>17f480342026e54000731acaa69bf32787ce46cb</id>
<content type='text'>
It currently is required that all users of NO_SUSPEND interrupt
lines pass the IRQF_NO_SUSPEND flag when requesting the IRQ or the
WARN_ON_ONCE() in irq_pm_install_action() will trigger.  That is
done to warn about situations in which unprepared interrupt handlers
may be run unnecessarily for suspended devices and may attempt to
access those devices by mistake.  However, it may cause drivers
that have no technical reasons for using IRQF_NO_SUSPEND to set
that flag just because they happen to share the interrupt line
with something like a timer.

Moreover, the generic handling of wakeup interrupts introduced by
commit 9ce7a25849e8 (genirq: Simplify wakeup mechanism) only works
for IRQs without any NO_SUSPEND users, so the drivers of wakeup
devices needing to use shared NO_SUSPEND interrupt lines for
signaling system wakeup generally have to detect wakeup in their
interrupt handlers.  Thus if they happen to share an interrupt line
with a NO_SUSPEND user, they also need to request that their
interrupt handlers be run after suspend_device_irqs().

In both cases the reason for using IRQF_NO_SUSPEND is not because
the driver in question has a genuine need to run its interrupt
handler after suspend_device_irqs(), but because it happens to
share the line with some other NO_SUSPEND user.  Otherwise, the
driver would do without IRQF_NO_SUSPEND just fine.

To make it possible to specify that condition explicitly, introduce
a new IRQ action handler flag for shared IRQs, IRQF_COND_SUSPEND,
that, when set, will indicate to the IRQ core that the interrupt
user is generally fine with suspending the IRQ, but it also can
tolerate handler invocations after suspend_device_irqs() and, in
particular, it is capable of detecting system wakeup and triggering
it as appropriate from its interrupt handler.

That will allow us to work around a problem with a shared timer
interrupt line on at91 platforms.

Link: http://marc.info/?l=linux-kernel&amp;m=142252777602084&amp;w=2
Link: http://marc.info/?t=142252775300011&amp;r=1&amp;w=2
Link: https://lkml.org/lkml/2014/12/15/552
Reported-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It currently is required that all users of NO_SUSPEND interrupt
lines pass the IRQF_NO_SUSPEND flag when requesting the IRQ or the
WARN_ON_ONCE() in irq_pm_install_action() will trigger.  That is
done to warn about situations in which unprepared interrupt handlers
may be run unnecessarily for suspended devices and may attempt to
access those devices by mistake.  However, it may cause drivers
that have no technical reasons for using IRQF_NO_SUSPEND to set
that flag just because they happen to share the interrupt line
with something like a timer.

Moreover, the generic handling of wakeup interrupts introduced by
commit 9ce7a25849e8 (genirq: Simplify wakeup mechanism) only works
for IRQs without any NO_SUSPEND users, so the drivers of wakeup
devices needing to use shared NO_SUSPEND interrupt lines for
signaling system wakeup generally have to detect wakeup in their
interrupt handlers.  Thus if they happen to share an interrupt line
with a NO_SUSPEND user, they also need to request that their
interrupt handlers be run after suspend_device_irqs().

In both cases the reason for using IRQF_NO_SUSPEND is not because
the driver in question has a genuine need to run its interrupt
handler after suspend_device_irqs(), but because it happens to
share the line with some other NO_SUSPEND user.  Otherwise, the
driver would do without IRQF_NO_SUSPEND just fine.

To make it possible to specify that condition explicitly, introduce
a new IRQ action handler flag for shared IRQs, IRQF_COND_SUSPEND,
that, when set, will indicate to the IRQ core that the interrupt
user is generally fine with suspending the IRQ, but it also can
tolerate handler invocations after suspend_device_irqs() and, in
particular, it is capable of detecting system wakeup and triggering
it as appropriate from its interrupt handler.

That will allow us to work around a problem with a shared timer
interrupt line on at91 platforms.

Link: http://marc.info/?l=linux-kernel&amp;m=142252777602084&amp;w=2
Link: http://marc.info/?t=142252775300011&amp;r=1&amp;w=2
Link: https://lkml.org/lkml/2014/12/15/552
Reported-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Provide disable_hardirq()</title>
<updated>2015-02-18T14:08:33+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2015-02-05T13:06:23+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=02cea3958664723a5d2236f0f0058de97c7e4693'/>
<id>02cea3958664723a5d2236f0f0058de97c7e4693</id>
<content type='text'>
For things like netpoll there is a need to disable an interrupt from
atomic context. Currently netpoll uses disable_irq() which will
sleep-wait on threaded handlers and thus forced_irqthreads breaks
things.

Provide disable_hardirq(), which uses synchronize_hardirq() to only wait
for active hardirq handlers; also change synchronize_hardirq() to
return the status of threaded handlers.

This will allow one to try-disable an interrupt from atomic context, or
in case of request_threaded_irq() to only wait for the hardirq part.

Suggested-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Eyal Perry &lt;eyalpe@mellanox.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Quentin Lambert &lt;lambert.quentin@gmail.com&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Link: http://lkml.kernel.org/r/20150205130623.GH5029@twins.programming.kicks-ass.net
[ Fixed typos and such. ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For things like netpoll there is a need to disable an interrupt from
atomic context. Currently netpoll uses disable_irq() which will
sleep-wait on threaded handlers and thus forced_irqthreads breaks
things.

Provide disable_hardirq(), which uses synchronize_hardirq() to only wait
for active hardirq handlers; also change synchronize_hardirq() to
return the status of threaded handlers.

This will allow one to try-disable an interrupt from atomic context, or
in case of request_threaded_irq() to only wait for the hardirq part.

Suggested-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Eyal Perry &lt;eyalpe@mellanox.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Quentin Lambert &lt;lambert.quentin@gmail.com&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Link: http://lkml.kernel.org/r/20150205130623.GH5029@twins.programming.kicks-ass.net
[ Fixed typos and such. ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
