lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87hay4dqjr.fsf@turtle.gmx.de>
Date:	Sun, 04 Mar 2012 22:06:32 +0100
From:	Sven Joachim <svenjoac@....de>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
	alan@...rguk.ukuu.org.uk, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [ 57/72] genirq: Unmask oneshot irqs when thread was not woken

On 2012-02-28 02:05 +0100, Greg KH wrote:

> 3.2-stable review patch.  If anyone has any objections, please let me know.

Alas, the commit below broke the WiFi on my laptop, where
"iwlist wlan0 scan" now just reports: " wlan0     No scan results".

This is not specific to 3.2, the same problem exists in 3.0.23 and
3.3-rc6 while previous releases worked.

The laptop is an Acer TravelMate 2490 with a Broadcom chip:

,----
| 06:02.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
| 	Subsystem: AMBIT Microsystem Corp. TravelMate 2410
| 	Flags: bus master, fast devsel, latency 64, IRQ 10
| 	Memory at d0002000 (32-bit, non-prefetchable) [size=8K]
| 	Kernel driver in use: b43-pci-bridge
`----

I'll be happy to give more information when needed.

Cheers,
       Sven


> From: Thomas Gleixner <tglx@...utronix.de>
>
> commit ac5637611150281f398bb7a47e3fcb69a09e7803 upstream.
>
> When the primary handler of an interrupt which is marked IRQ_ONESHOT
> returns IRQ_HANDLED or IRQ_NONE, then the interrupt thread is not
> woken and the unmask logic of the interrupt line is never
> invoked. This keeps the interrupt masked forever.
>
> This was not noticed as most IRQ_ONESHOT users wake the thread
> unconditionally (usually because they cannot access the underlying
> device from hard interrupt context). Though this behaviour was nowhere
> documented and not necessarily intentional. Some drivers can avoid the
> thread wakeup in certain cases and run into the situation where the
> interrupt line s kept masked.
>
> Handle it gracefully.
>
> Reported-and-tested-by: Lothar Wassmann <lw@...o-electronics.de>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>
> ---
>  kernel/irq/chip.c |   25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
>
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -330,6 +330,24 @@ out_unlock:
>  }
>  EXPORT_SYMBOL_GPL(handle_simple_irq);
>  
> +/*
> + * Called unconditionally from handle_level_irq() and only for oneshot
> + * interrupts from handle_fasteoi_irq()
> + */
> +static void cond_unmask_irq(struct irq_desc *desc)
> +{
> +	/*
> +	 * We need to unmask in the following cases:
> +	 * - Standard level irq (IRQF_ONESHOT is not set)
> +	 * - Oneshot irq which did not wake the thread (caused by a
> +	 *   spurious interrupt or a primary handler handling it
> +	 *   completely).
> +	 */
> +	if (!irqd_irq_disabled(&desc->irq_data) &&
> +	    irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot)
> +		unmask_irq(desc);
> +}
> +
>  /**
>   *	handle_level_irq - Level type irq handler
>   *	@irq:	the interrupt number
> @@ -362,8 +380,8 @@ handle_level_irq(unsigned int irq, struc
>  
>  	handle_irq_event(desc);
>  
> -	if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT))
> -		unmask_irq(desc);
> +	cond_unmask_irq(desc);
> +
>  out_unlock:
>  	raw_spin_unlock(&desc->lock);
>  }
> @@ -417,6 +435,9 @@ handle_fasteoi_irq(unsigned int irq, str
>  	preflow_handler(desc);
>  	handle_irq_event(desc);
>  
> +	if (desc->istate & IRQS_ONESHOT)
> +		cond_unmask_irq(desc);
> +
>  out_eoi:
>  	desc->irq_data.chip->irq_eoi(&desc->irq_data);
>  out_unlock:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ