From: Greg KH <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, Thomas Gleixner <tglx@linutronix.de>
Subject: [ 23/95] genirq: Clear action->thread_mask if IRQ_ONESHOT is not set
Date: Fri, 09 Mar 2012 11:02:25 -0800 [thread overview]
Message-ID: <20120309190204.196160159@linuxfoundation.org> (raw)
In-Reply-To: <20120309194424.GA2134@kroah.com>
3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit 52abb700e16a9aa4cbc03f3d7f80206cbbc80680 upstream.
Xommit ac5637611(genirq: Unmask oneshot irqs when thread was not woken)
fails to unmask when a !IRQ_ONESHOT threaded handler is handled by
handle_level_irq.
This happens because thread_mask is or'ed unconditionally in
irq_wake_thread(), but for !IRQ_ONESHOT interrupts never cleared. So
the check for !desc->thread_active fails and keeps the interrupt
disabled.
Keep the thread_mask zero for !IRQ_ONESHOT interrupts.
Document the thread_mask magic while at it.
Reported-and-tested-by: Sven Joachim <svenjoac@gmx.de>
Reported-and-tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/irq/manage.c | 44 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 6 deletions(-)
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -985,6 +985,11 @@ __setup_irq(unsigned int irq, struct irq
/* add new interrupt at end of irq queue */
do {
+ /*
+ * Or all existing action->thread_mask bits,
+ * so we can find the next zero bit for this
+ * new action.
+ */
thread_mask |= old->thread_mask;
old_ptr = &old->next;
old = *old_ptr;
@@ -993,14 +998,41 @@ __setup_irq(unsigned int irq, struct irq
}
/*
- * Setup the thread mask for this irqaction. Unlikely to have
- * 32 resp 64 irqs sharing one line, but who knows.
+ * Setup the thread mask for this irqaction for ONESHOT. For
+ * !ONESHOT irqs the thread mask is 0 so we can avoid a
+ * conditional in irq_wake_thread().
*/
- if (new->flags & IRQF_ONESHOT && thread_mask == ~0UL) {
- ret = -EBUSY;
- goto out_mask;
+ if (new->flags & IRQF_ONESHOT) {
+ /*
+ * Unlikely to have 32 resp 64 irqs sharing one line,
+ * but who knows.
+ */
+ if (thread_mask == ~0UL) {
+ ret = -EBUSY;
+ goto out_mask;
+ }
+ /*
+ * The thread_mask for the action is or'ed to
+ * desc->thread_active to indicate that the
+ * IRQF_ONESHOT thread handler has been woken, but not
+ * yet finished. The bit is cleared when a thread
+ * completes. When all threads of a shared interrupt
+ * line have completed desc->threads_active becomes
+ * zero and the interrupt line is unmasked. See
+ * handle.c:irq_wake_thread() for further information.
+ *
+ * If no thread is woken by primary (hard irq context)
+ * interrupt handlers, then desc->threads_active is
+ * also checked for zero to unmask the irq line in the
+ * affected hard irq flow handlers
+ * (handle_[fasteoi|level]_irq).
+ *
+ * The new action gets the first zero bit of
+ * thread_mask assigned. See the loop above which or's
+ * all existing action->thread_mask bits.
+ */
+ new->thread_mask = 1 << ffz(thread_mask);
}
- new->thread_mask = 1 << ffz(thread_mask);
if (!shared) {
init_waitqueue_head(&desc->wait_for_threads);
next prev parent reply other threads:[~2012-03-09 19:02 UTC|newest]
Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 19:44 [ 00/95] 3.2.10-stable review Greg KH
2012-03-09 19:02 ` [ 01/95] ARM: OMAP: make iommu subsys_initcall to fix builtin omap3isp Greg KH
2012-03-10 12:47 ` Ohad Ben-Cohen
2012-03-11 17:10 ` Greg KH
2012-03-09 19:02 ` [ 02/95] autofs: work around unhappy compat problem on x86-64 Greg KH
2012-03-09 19:02 ` [ 03/95] Fix autofs compile without CONFIG_COMPAT Greg KH
2012-03-09 19:02 ` [ 04/95] compat: fix compile breakage on s390 Greg KH
2012-03-09 19:02 ` [ 05/95] drm/i915: Prevent a machine hang by checking crtc->active before loading lut Greg KH
2012-03-09 19:02 ` [ 06/95] ARM: LPC32xx: serial.c: HW bug workaround Greg KH
2012-03-09 19:02 ` [ 07/95] ARM: LPC32xx: serial.c: Fixed loop limit Greg KH
2012-03-09 19:02 ` [ 08/95] ARM: LPC32xx: irq.c: Clear latched event Greg KH
2012-03-09 19:02 ` [ 09/95] ARM: LPC32xx: Fix interrupt controller init Greg KH
2012-03-09 19:02 ` [ 10/95] ARM: LPC32xx: Fix irq on GPI_28 Greg KH
2012-03-09 19:02 ` [ 11/95] watchdog: hpwdt: clean up set_memory_x call for 32 bit Greg KH
2012-03-09 19:02 ` [ 12/95] i2c: mxs: only flag completion when queue is completely done Greg KH
2012-03-09 19:02 ` [ 13/95] regulator: fix the ldo configure according to 88pm860x spec Greg KH
2012-03-09 19:02 ` [ 14/95] S390: KEYS: Enable the compat keyctl wrapper on s390x Greg KH
2012-03-09 19:02 ` [ 15/95] perf/x86/kvm: Fix Host-Only/Guest-Only counting with SVM disabled Greg KH
2012-03-09 19:02 ` [ 16/95] ALSA: hda/realtek - Fix resume of multiple input sources Greg KH
2012-03-09 19:02 ` [ 17/95] ALSA: hda - Add a fake mute feature Greg KH
2012-03-09 19:02 ` [ 18/95] ALSA: hda - Always set HP pin in unsol handler for STAC/IDT codecs Greg KH
2012-03-09 19:02 ` [ 19/95] regset: Prevent null pointer reference on readonly regsets Greg KH
2012-03-09 19:02 ` [ 20/95] regset: Return -EFAULT, not -EIO, on host-side memory fault Greg KH
2012-03-09 19:02 ` [ 21/95] mfd: Fix ACPI conflict check Greg KH
2012-03-09 19:02 ` [ 22/95] mfd: Test for jack detection when deciding if wm8994 should suspend Greg KH
2012-03-09 19:02 ` Greg KH [this message]
2012-03-09 19:02 ` [ 24/95] ARM: S3C24XX: DMA resume regression fix Greg KH
2012-03-09 19:02 ` [ 25/95] Move Logitech Harmony 900 from cdc_ether to zaurus Greg KH
2012-03-09 19:02 ` [ 26/95] alpha: fix 32/64-bit bug in futex support Greg KH
2012-03-09 19:02 ` [ 27/95] mmc: atmel-mci: dont use dma features when using DMA with no chan available Greg KH
2012-03-09 19:02 ` [ 28/95] mmc: sdhci-esdhc-imx: fix for mmc cards on i.MX5 Greg KH
2012-03-09 19:02 ` [ 29/95] aio: wake up waiters when freeing unused kiocbs Greg KH
2012-03-09 19:02 ` [ 30/95] mm: memcg: Correct unregistring of events attached to the same eventfd Greg KH
2012-03-09 19:02 ` [ 31/95] NOMMU: Dont need to clear vm_mm when deleting a VMA Greg KH
2012-03-09 19:02 ` [ 32/95] cifs: fix dentry refcount leak when opening a FIFO on lookup Greg KH
2012-03-09 19:02 ` [ 33/95] mac80211: zero initialize count field in ieee80211_tx_rate Greg KH
2012-03-09 19:02 ` [ 34/95] ath9k_hw: prevent writes to const data on AR9160 Greg KH
2012-03-09 19:02 ` [ 35/95] kprobes: return proper error code from register_kprobe() Greg KH
2012-03-09 19:02 ` [ 36/95] mm: thp: fix BUG on mm->nr_ptes Greg KH
2012-03-09 19:02 ` [ 37/95] iwlwifi: fix key removal Greg KH
2012-03-09 19:02 ` [ 38/95] tty/powerpc: early udbg consoles cant be modules Greg KH
2012-03-09 19:02 ` [ 39/95] S390: qdio: fix handler function arguments for zfcp data router Greg KH
2012-03-09 19:02 ` [ 40/95] rapidio/tsi721: fix queue wrapping bug in inbound doorbell handler Greg KH
2012-03-09 19:02 ` [ 41/95] HID: usbhid: Add NOGET quirk for the AIREN Slim+ keyboard Greg KH
2012-03-09 19:02 ` [ 42/95] crypto: mv_cesa - fix final callback not ignoring input data Greg KH
2012-03-09 19:02 ` [ 43/95] [SCSI] osd_uld: Bump MAX_OSD_DEVICES from 64 to 1,048,576 Greg KH
2012-03-09 19:02 ` [ 44/95] viafb: select HW scaling on VX900 for IGA2 Greg KH
2012-03-09 19:02 ` [ 45/95] viafb: fix IGA1 modesetting on VX900 Greg KH
2012-03-09 19:02 ` [ 46/95] ASoC: dapm: Check for bias level when powering down Greg KH
2012-03-09 19:02 ` [ 47/95] ASoC: i.MX SSI: Fix DSP_A format Greg KH
2012-03-09 19:02 ` [ 48/95] bsg: fix sysfs link remove warning Greg KH
2012-03-09 19:02 ` [ 49/95] avr32: select generic atomic64_t support Greg KH
2012-03-09 19:02 ` [ 50/95] ACPI / PM: Do not save/restore NVS on Asus K54C/K54HR Greg KH
2012-03-09 19:02 ` [ 51/95] rtl8192cu: Add new device IDs Greg KH
2012-03-09 19:02 ` [ 52/95] drm/i915: gen7: implement rczunit workaround Greg KH
2012-03-09 19:02 ` [ 53/95] drm/i915: gen7: Implement an L3 caching workaround Greg KH
2012-03-09 19:02 ` [ 54/95] drm/i915: gen7: work around a system hang on IVB Greg KH
2012-03-09 19:02 ` [ 55/95] drm/i915: gen7: Disable the RHWO optimization as it can cause GPU hangs Greg KH
2012-03-09 19:02 ` [ 56/95] drm/i915: fix ELD writing for SandyBridge Greg KH
2012-03-09 19:02 ` [ 57/95] ARM: orion: Fix USB phy for orion5x Greg KH
2012-03-09 19:03 ` [ 58/95] ARM: orion: Fix Orion5x GPIO regression from MPP cleanup Greg KH
2012-03-09 19:03 ` [ 59/95] OMAP: 4430SDP/Panda: use gpio_free_array to free HDMI gpios Greg KH
2012-03-09 19:03 ` [ 60/95] OMAP: 4430SDP/Panda: rename HPD GPIO to CT_CP_HPD Greg KH
2012-03-09 19:03 ` [ 61/95] OMAPDSS: remove wrong HDMI HPD muxing Greg KH
2012-03-09 19:03 ` [ 62/95] OMAP: 4430SDP/Panda: setup HDMI GPIO muxes Greg KH
2012-03-09 19:03 ` [ 63/95] OMAP: 4430SDP/Panda: add HDMI HPD gpio Greg KH
2012-03-09 19:03 ` [ 64/95] OMAPDSS: HDMI: PHY burnout fix Greg KH
2012-03-09 19:03 ` [ 65/95] OMAPDSS: HDMI: hot plug detect fix Greg KH
2012-03-09 19:03 ` [ 66/95] ARM: 7345/1: errata: update workaround for A9 erratum #743622 Greg KH
2012-03-09 19:03 ` [ 67/95] ARM: 7354/1: perf: limit sample_period to half max_period in non-sampling mode Greg KH
2012-03-09 19:03 ` [ 68/95] ARM: 7355/1: perf: clear overflow flag when disabling counter on ARMv7 PMU Greg KH
2012-03-09 19:03 ` [ 69/95] ARM: 7356/1: perf: check that we have an event in the PMU IRQ handlers Greg KH
2012-03-09 19:03 ` [ 70/95] ARM: 7357/1: perf: fix overflow handling for xscale2 PMUs Greg KH
2012-03-09 19:03 ` [ 71/95] media: staging: lirc_serial: Fix init/exit order Greg KH
2012-03-09 19:03 ` [ 72/95] media: staging: lirc_serial: Free resources on failure paths of lirc_serial_probe() Greg KH
2012-03-09 19:03 ` [ 73/95] media: staging: lirc_serial: Fix deadlock on resume failure Greg KH
2012-03-09 19:03 ` [ 74/95] media: staging: lirc_serial: Do not assume error codes returned by request_irq() Greg KH
2012-03-09 19:03 ` [ 75/95] Input: ALPS - fix touchpad detection when buttons are pressed Greg KH
2012-03-09 19:03 ` [ 76/95] hwmon: (pmbus_core) Fix maximum number of POUT alarm attributes Greg KH
2012-03-09 19:03 ` [ 77/95] hwmon: (jc42) Add support for ST Microelectronics STTS2002 and STTS3000 Greg KH
2012-03-09 19:03 ` [ 78/95] hwmon: (jc42) Add support for AT30TS00, TS3000GB2, TSE2002GB2, and MCP9804 Greg KH
2012-03-09 19:03 ` [ 79/95] hwmon: (zl6100) Maintain delay parameter in driver instance data Greg KH
2012-03-09 19:03 ` [ 80/95] carl9170: Fix memory accounting when sta is in power-save mode Greg KH
2012-03-09 19:03 ` [ 81/95] carl9170: fix frame delivery if sta is in powersave mode Greg KH
2012-03-09 19:03 ` [ 82/95] drm/radeon/kms: set SX_MISC in the r6xx blit code (v2) Greg KH
2012-03-09 19:03 ` [ 83/95] net/usbnet: avoid recursive locking in usbnet_stop() Greg KH
2012-03-09 19:03 ` [ 84/95] x86/amd: iommu_set_device_table() must not be __init Greg KH
2012-03-09 19:03 ` [ 85/95] dm ioctl: do not leak argv if target message only contains whitespace Greg KH
2012-03-09 19:03 ` [ 86/95] dm io: fix discard support Greg KH
2012-03-09 19:03 ` [ 87/95] dm flakey: fix crash on read when corrupt_bio_byte not set Greg KH
2012-03-09 19:03 ` [ 88/95] dm thin metadata: remove incorrect close_device on creation error paths Greg KH
2012-03-09 19:03 ` [ 89/95] dm thin metadata: unlock superblock in init_pmd error path Greg KH
2012-03-09 19:03 ` [ 90/95] dm thin metadata: decrement counter after removing mapped block Greg KH
2012-03-09 19:03 ` [ 91/95] dm raid: set MD_CHANGE_DEVS when rebuilding Greg KH
2012-03-09 19:03 ` [ 92/95] dm raid: fix flush support Greg KH
2012-03-09 19:03 ` [ 93/95] cs5535-mfgpt: dont call __init function from __devinit Greg KH
2012-03-09 19:03 ` [ 94/95] mfd: Fix cs5535 section mismatch Greg KH
2012-03-09 19:03 ` [ 95/95] spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120309190204.196160159@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).