linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert lazy irq disable for simple irqs
@ 2007-12-12 20:20 Steven Rostedt
  2007-12-13 10:22 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Steven Rostedt @ 2007-12-12 20:20 UTC (permalink / raw)
  To: LKML
  Cc: Russell King, Thomas Gleixner, Ingo Molnar, Remy Bohmer,
	Daniel Walker, Linus Torvalds, Andrew Morton


[This patch *is* for mainline Linux]

In commit 76d2160147f43f982dfe881404cfde9fd0a9da21 lazy irq disabling
was implemented, and the simple irq handler had a masking set to it.

Remy Bohmer discovered that some devices in the ARM architecture
would trigger the mask, but never unmask it. His patch to do the
unmasking was questioned by Russell King about masking simple irqs
to begin with. Looking further, it was discovered that the problems
Remy was seeing was due to improper use of the simple handler by
devices, and he later submitted patches to fix those. But the issue
that was uncovered was that the simple handler should never mask.

This patch reverts the masking in the simple handler.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>

---
 kernel/irq/chip.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Index: linux-compile.git/kernel/irq/chip.c
===================================================================
--- linux-compile.git.orig/kernel/irq/chip.c	2007-10-19 12:37:51.000000000 -0400
+++ linux-compile.git/kernel/irq/chip.c	2007-12-12 15:03:43.000000000 -0500
@@ -297,18 +297,13 @@ handle_simple_irq(unsigned int irq, stru

 	if (unlikely(desc->status & IRQ_INPROGRESS))
 		goto out_unlock;
+	desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
 	kstat_cpu(cpu).irqs[irq]++;

 	action = desc->action;
-	if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
-		if (desc->chip->mask)
-			desc->chip->mask(irq);
-		desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
-		desc->status |= IRQ_PENDING;
+	if (unlikely(!action || (desc->status & IRQ_DISABLED)))
 		goto out_unlock;
-	}

-	desc->status &= ~(IRQ_REPLAY | IRQ_WAITING | IRQ_PENDING);
 	desc->status |= IRQ_INPROGRESS;
 	spin_unlock(&desc->lock);



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert lazy irq disable for simple irqs
  2007-12-12 20:20 [PATCH] Revert lazy irq disable for simple irqs Steven Rostedt
@ 2007-12-13 10:22 ` Ingo Molnar
  2007-12-13 13:00   ` Steven Rostedt
  2007-12-13 10:26 ` Russell King
  2007-12-13 11:01 ` Remy Bohmer
  2 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2007-12-13 10:22 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Russell King, Thomas Gleixner, Remy Bohmer, Daniel Walker,
	Linus Torvalds, Andrew Morton


* Steven Rostedt <rostedt@goodmis.org> wrote:

> [This patch *is* for mainline Linux]
> 
> In commit 76d2160147f43f982dfe881404cfde9fd0a9da21 lazy irq disabling 
> was implemented, and the simple irq handler had a masking set to it.
> 
> Remy Bohmer discovered that some devices in the ARM architecture would 
> trigger the mask, but never unmask it. His patch to do the unmasking 
> was questioned by Russell King about masking simple irqs to begin 
> with. Looking further, it was discovered that the problems Remy was 
> seeing was due to improper use of the simple handler by devices, and 
> he later submitted patches to fix those. But the issue that was 
> uncovered was that the simple handler should never mask.
> 
> This patch reverts the masking in the simple handler.
> 
> Signed-off-by: Steven Rostedt <srostedt@redhat.com>

thanks, applied. This is for v2.6.24 too, right?

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert lazy irq disable for simple irqs
  2007-12-12 20:20 [PATCH] Revert lazy irq disable for simple irqs Steven Rostedt
  2007-12-13 10:22 ` Ingo Molnar
@ 2007-12-13 10:26 ` Russell King
  2007-12-13 11:01 ` Remy Bohmer
  2 siblings, 0 replies; 5+ messages in thread
From: Russell King @ 2007-12-13 10:26 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Thomas Gleixner, Ingo Molnar, Remy Bohmer, Daniel Walker,
	Linus Torvalds, Andrew Morton

On Wed, Dec 12, 2007 at 03:20:10PM -0500, Steven Rostedt wrote:
> 
> [This patch *is* for mainline Linux]
> 
> In commit 76d2160147f43f982dfe881404cfde9fd0a9da21 lazy irq disabling
> was implemented, and the simple irq handler had a masking set to it.
> 
> Remy Bohmer discovered that some devices in the ARM architecture
> would trigger the mask, but never unmask it. His patch to do the
> unmasking was questioned by Russell King about masking simple irqs
> to begin with. Looking further, it was discovered that the problems
> Remy was seeing was due to improper use of the simple handler by
> devices, and he later submitted patches to fix those. But the issue
> that was uncovered was that the simple handler should never mask.
> 
> This patch reverts the masking in the simple handler.
> 
> Signed-off-by: Steven Rostedt <srostedt@redhat.com>

Thanks.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert lazy irq disable for simple irqs
  2007-12-12 20:20 [PATCH] Revert lazy irq disable for simple irqs Steven Rostedt
  2007-12-13 10:22 ` Ingo Molnar
  2007-12-13 10:26 ` Russell King
@ 2007-12-13 11:01 ` Remy Bohmer
  2 siblings, 0 replies; 5+ messages in thread
From: Remy Bohmer @ 2007-12-13 11:01 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Russell King, Thomas Gleixner, Ingo Molnar, Daniel Walker,
	Linus Torvalds, Andrew Morton

Hello Steven,

> In commit 76d2160147f43f982dfe881404cfde9fd0a9da21 lazy irq disabling
> was implemented, and the simple irq handler had a masking set to it.
>
> Remy Bohmer discovered that some devices in the ARM architecture
> would trigger the mask, but never unmask it. His patch to do the
> unmasking was questioned by Russell King about masking simple irqs
> to begin with. Looking further, it was discovered that the problems
> Remy was seeing was due to improper use of the simple handler by
> devices, and he later submitted patches to fix those. But the issue
> that was uncovered was that the simple handler should never mask.
>
> This patch reverts the masking in the simple handler.
>
Acked-by: Remy Bohmer <linux@bohmer.net>




> ---
>  kernel/irq/chip.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> Index: linux-compile.git/kernel/irq/chip.c
> ===================================================================
> --- linux-compile.git.orig/kernel/irq/chip.c    2007-10-19 12:37:51.000000000 -0400
> +++ linux-compile.git/kernel/irq/chip.c 2007-12-12 15:03:43.000000000 -0500
> @@ -297,18 +297,13 @@ handle_simple_irq(unsigned int irq, stru
>
>         if (unlikely(desc->status & IRQ_INPROGRESS))
>                 goto out_unlock;
> +       desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
>         kstat_cpu(cpu).irqs[irq]++;
>
>         action = desc->action;
> -       if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
> -               if (desc->chip->mask)
> -                       desc->chip->mask(irq);
> -               desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
> -               desc->status |= IRQ_PENDING;
> +       if (unlikely(!action || (desc->status & IRQ_DISABLED)))
>                 goto out_unlock;
> -       }
>
> -       desc->status &= ~(IRQ_REPLAY | IRQ_WAITING | IRQ_PENDING);
>         desc->status |= IRQ_INPROGRESS;
>         spin_unlock(&desc->lock);
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert lazy irq disable for simple irqs
  2007-12-13 10:22 ` Ingo Molnar
@ 2007-12-13 13:00   ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2007-12-13 13:00 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Russell King, Thomas Gleixner, Remy Bohmer, Daniel Walker,
	Linus Torvalds, Andrew Morton


On Thu, 13 Dec 2007, Ingo Molnar wrote:

>
> * Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > [This patch *is* for mainline Linux]
> >
> > In commit 76d2160147f43f982dfe881404cfde9fd0a9da21 lazy irq disabling
> > was implemented, and the simple irq handler had a masking set to it.

>
> thanks, applied. This is for v2.6.24 too, right?
>

Probably should be. The patch only reverts the change for
handle_simple_irq that shouldn't have been done in the first place. At
worse, this patch just takes us back to what handle_simple_irq use to do,
and at best, it prevents bugs where we somehow fall into the "mask" path
of handle_simple_irq and never unmask. But to hit that path, the driver
probably shouldn't be using handle_simple_irq ;-)

Thanks,

-- Steve


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-13 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-12 20:20 [PATCH] Revert lazy irq disable for simple irqs Steven Rostedt
2007-12-13 10:22 ` Ingo Molnar
2007-12-13 13:00   ` Steven Rostedt
2007-12-13 10:26 ` Russell King
2007-12-13 11:01 ` Remy Bohmer

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).