linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Stefan Lippers-Hollmann <s.L-H@gmx.de>,
	Greg KH <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Jonathan Nieder <jrnieder@gmail.com>,
	linux-wireless@vger.kernel.org,
	Stefano Brivio <stefano.brivio@polimi.it>
Subject: Re: [ 57/72] genirq: Unmask oneshot irqs when thread was not woken
Date: Tue, 06 Mar 2012 22:07:30 +0100	[thread overview]
Message-ID: <87r4x5zbe5.fsf@turtle.gmx.de> (raw)
In-Reply-To: <alpine.LFD.2.02.1203062101040.2742@ionos> (Thomas Gleixner's message of "Tue, 6 Mar 2012 21:26:07 +0100 (CET)")

Am 06.03.2012 um 21:26 schrieb Thomas Gleixner:

> 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 ?

Yep, it does.  Thanks!

> ----------------->
> 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 <svenjoac@gmx.de>
> Cc: stable@vger.kernel.org
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>
> 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);

  parent reply	other threads:[~2012-03-06 21:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120228010511.GA8453@kroah.com>
     [not found] ` <20120228010434.412979550@linuxfoundation.org>
     [not found]   ` <87hay4dqjr.fsf@turtle.gmx.de>
2012-03-04 21:53     ` [ 57/72] genirq: Unmask oneshot irqs when thread was not woken Jonathan Nieder
2012-03-04 22:08       ` Sven Joachim
2012-03-05  0:43     ` Stefan Lippers-Hollmann
2012-03-06  0:34       ` Linus Torvalds
2012-03-06  8:28         ` Thomas Gleixner
2012-03-06  9:52           ` Thomas Gleixner
2012-03-06 19:31             ` Thomas Gleixner
2012-03-06 19:53               ` Sven Joachim
2012-03-06 20:26                 ` Thomas Gleixner
2012-03-06 20:54                   ` Thomas Gleixner
2012-03-06 21:07                   ` Sven Joachim [this message]
2012-03-06 21:11                     ` Thomas Gleixner
2012-03-06 21:40                       ` Linus Torvalds
2012-03-06 21:08                   ` Stefan Lippers-Hollmann
2012-03-06 21:40                   ` Linus Torvalds
2012-03-06 21:47                     ` Linus Torvalds
2012-03-06 22:18                     ` Thomas Gleixner
2012-03-06 22:33                       ` Linus Torvalds
2012-03-06 23:38                         ` Stefan Lippers-Hollmann
2012-03-07  5:36                         ` Sven Joachim
2012-03-06 20:25               ` Stefan Lippers-Hollmann
2012-03-06 19:45       ` Thomas Gleixner
2012-03-06 20:10         ` Sven Joachim

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=87r4x5zbe5.fsf@turtle.gmx.de \
    --to=svenjoac@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jrnieder@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=s.L-H@gmx.de \
    --cc=stable@vger.kernel.org \
    --cc=stefano.brivio@polimi.it \
    --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).