Return-path: Received: from www.linutronix.de ([62.245.132.108]:59491 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932377Ab2CFU0L (ORCPT ); Tue, 6 Mar 2012 15:26:11 -0500 Date: Tue, 6 Mar 2012 21:26:07 +0100 (CET) From: Thomas Gleixner To: Sven Joachim cc: Linus Torvalds , Stefan Lippers-Hollmann , Greg KH , LKML , stable@vger.kernel.org, Andrew Morton , Alan Cox , Jonathan Nieder , linux-wireless@vger.kernel.org, Stefano Brivio Subject: Re: [ 57/72] genirq: Unmask oneshot irqs when thread was not woken In-Reply-To: <8762eh1p7d.fsf@turtle.gmx.de> Message-ID: (sfid-20120306_212629_840863_295B25F9) References: <20120228010511.GA8453@kroah.com> <20120228010434.412979550@linuxfoundation.org> <87hay4dqjr.fsf@turtle.gmx.de> <201203050143.24541.s.L-H@gmx.de> <8762eh1p7d.fsf@turtle.gmx.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 6 Mar 2012, Sven Joachim wrote: > Am 06.03.2012 um 20:31 schrieb Thomas Gleixner: > > > Stephan, Sven: Can you please provide the output of /proc/interrupts ? > > Here is mine, from a freshly booted 3.3-rc6 kernel. > > Cheers, > Sven > > CPU0 > 0: 25050 XT-PIC-XT-PIC timer > 1: 101 XT-PIC-XT-PIC i8042 > 2: 0 XT-PIC-XT-PIC cascade > 3: 1 XT-PIC-XT-PIC > 4: 1 XT-PIC-XT-PIC > 5: 0 XT-PIC-XT-PIC ehci_hcd:usb1, uhci_hcd:usb2 > 6: 1 XT-PIC-XT-PIC i915, uhci_hcd:usb5, yenta > 7: 1 XT-PIC-XT-PIC > 8: 0 XT-PIC-XT-PIC rtc0 > 9: 634 XT-PIC-XT-PIC acpi > 10: 341 XT-PIC-XT-PIC uhci_hcd:usb4, snd_hda_intel, b43 Ah, XT-PIC uses handle_level_irq(). /me bangs head against desk. Does the patch below fix the problem for you ? Thanks, tglx -----------------> Subject: genirq: Clear action->thread_mask if IRQ_ONESHOT is not set commit 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. Reported-by: Sven Joachim Cc: stable@vger.kernel.org Signed-off-by: Thomas Gleixner --- Index: linux-2.6/kernel/irq/manage.c =================================================================== --- linux-2.6.orig/kernel/irq/manage.c +++ linux-2.6/kernel/irq/manage.c @@ -996,11 +996,13 @@ __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. */ - if (new->flags & IRQF_ONESHOT && thread_mask == ~0UL) { - ret = -EBUSY; - goto out_mask; + if (new->flags & IRQF_ONESHOT) { + if (thread_mask == ~0UL) { + ret = -EBUSY; + goto out_mask; + } + new->thread_mask = new->flags & IRQF_ONESHOT; } - new->thread_mask = 1 << ffz(thread_mask); if (!shared) { init_waitqueue_head(&desc->wait_for_threads);