login
Header Space

 
 

Re: Linux 2.6.20-rc6 - sky2 resume breakage

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff Garzik <jeff@...>
Cc: Linus Torvalds <torvalds@...>, Stephen Hemminger <shemminger@...>, Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, January 30, 2007 - 3:53 am

* Jeff Garzik <jeff@garzik.org> wrote:


Yeah. Admittedly, ATA is very special because it is still edge-triggered 
most of the time (for legacy reasons):

 14:     389907          0   IO-APIC-edge      ide0

so if it shares an irq with a device that has level-triggered 
assumptions, those two dont intermix very well. That's why i have the 
delayed-disable patches (see the two patches below), which will unify 
the two methods, and the irq flow handling method will be mostly a 
'performance hint' not a correctness issue. This has been in -rt for 
quite a few weeks now and it works well.

btw., it would be great if you could help us here: could you perhaps, 
from a past example, outline a specific case of such an ATA/USB IRQ 
storm and how it occured (precisely) - and what the fix was? I'd like to 
analyze a specific case to make sure the genirq layer recovers from such 
cases more gracefully. In general, i think the IRQ subsystem needs to 
become more failure-resilient and needs to become more auto-learning 
(and these two dont stand in the way of good performance). This problem 
of shared IRQs will be with us for at least another 10 years, if not 
more. (for example ISA is /still/ not dead everywhere and it was already 
legacy technology 15 years ago when Linux was started.)

	Ingo

------------------->
Subject: irq: do not mask interrupts by default
From: Ingo Molnar <mingo@elte.hu>

never mask interrupts immediately upon request. Disabling interrupts in 
high-performance codepaths is rare, and on the other hand this change 
could recover lost edges (or even other types of lost interrupts) by 
conservatively only masking interrupts after they happen. (NOTE: with 
this change the highlevel irq-disable code still soft-disables this IRQ 
line - and if such an interrupt happens then the IRQ flow handler keeps 
the IRQ masked.)

mark i8529A controllers as 'never loses an edge'.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/i386/kernel/i8259.c   |    1 +
 arch/x86_64/kernel/i8259.c |    1 +
 kernel/irq/chip.c          |   17 ++++++++++-------
 3 files changed, 12 insertions(+), 7 deletions(-)

Index: linux/arch/i386/kernel/i8259.c
===================================================================
--- linux.orig/arch/i386/kernel/i8259.c
+++ linux/arch/i386/kernel/i8259.c
@@ -41,6 +41,7 @@ static void mask_and_ack_8259A(unsigned 
 static struct irq_chip i8259A_chip = {
 	.name		= "XT-PIC",
 	.mask		= disable_8259A_irq,
+	.disable	= disable_8259A_irq,
 	.unmask		= enable_8259A_irq,
 	.mask_ack	= mask_and_ack_8259A,
 };
Index: linux/arch/x86_64/kernel/i8259.c
===================================================================
--- linux.orig/arch/x86_64/kernel/i8259.c
+++ linux/arch/x86_64/kernel/i8259.c
@@ -103,6 +103,7 @@ static void mask_and_ack_8259A(unsigned 
 static struct irq_chip i8259A_chip = {
 	.name		= "XT-PIC",
 	.mask		= disable_8259A_irq,
+	.disable	= disable_8259A_irq,
 	.unmask		= enable_8259A_irq,
 	.mask_ack	= mask_and_ack_8259A,
 };
Index: linux/kernel/irq/chip.c
===================================================================
--- linux.orig/kernel/irq/chip.c
+++ linux/kernel/irq/chip.c
@@ -202,10 +202,6 @@ static void default_enable(unsigned int 
  */
 static void default_disable(unsigned int irq)
 {
-	struct irq_desc *desc = irq_desc + irq;
-
-	if (!(desc->status & IRQ_DELAYED_DISABLE))
-		desc->chip->mask(irq);
 }
 
 /*
@@ -270,13 +266,18 @@ 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 (unlikely(!action || (desc->status & IRQ_DISABLED))) {
+		if (desc->chip->mask)
+			desc->chip->mask(irq);
+		desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
+		desc->status |= IRQ_PENDING;
 		goto out_unlock;
+	}
 
+	desc->status &= ~(IRQ_REPLAY | IRQ_WAITING | IRQ_PENDING);
 	desc->status |= IRQ_INPROGRESS;
 	spin_unlock(&desc->lock);
 
@@ -368,11 +369,13 @@ handle_fasteoi_irq(unsigned int irq, str
 
 	/*
 	 * If its disabled or no action available
-	 * keep it masked and get out of here
+	 * then mask it and get out of here:
 	 */
 	action = desc->action;
 	if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
 		desc->status |= IRQ_PENDING;
+		if (desc->chip->mask)
+			desc->chip->mask(irq);
 		goto out;
 	}

----------------------> 
Subject: genirq: remove IRQ_DISABLED
From: Ingo Molnar <mingo@elte.hu>

now that disable_irq() defaults to delayed-disable semantics, the 
IRQ_DISABLED flag is not needed anymore.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/arm/kernel/irq.c                 |    3 +--
 arch/i386/kernel/io_apic.c            |    4 +---
 arch/powerpc/platforms/powermac/pic.c |    2 --
 arch/x86_64/kernel/io_apic.c          |    4 +---
 include/linux/irq.h                   |    7 +++----
 5 files changed, 6 insertions(+), 14 deletions(-)

Index: linux/arch/arm/kernel/irq.c
===================================================================
--- linux.orig/arch/arm/kernel/irq.c
+++ linux/arch/arm/kernel/irq.c
@@ -159,8 +159,7 @@ void __init init_IRQ(void)
 	int irq;
 
 	for (irq = 0; irq < NR_IRQS; irq++)
-		irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_DELAYED_DISABLE |
-			IRQ_NOPROBE;
+		irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE;
 
 #ifdef CONFIG_SMP
 	bad_irq_desc.affinity = CPU_MASK_ALL;
Index: linux/arch/i386/kernel/io_apic.c
===================================================================
--- linux.orig/arch/i386/kernel/io_apic.c
+++ linux/arch/i386/kernel/io_apic.c
@@ -1275,11 +1275,9 @@ static void ioapic_register_intr(int irq
 			trigger == IOAPIC_LEVEL)
 		set_irq_chip_and_handler_name(irq, &ioapic_chip,
 					 handle_fasteoi_irq, "fasteoi");
-	else {
-		irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
+	else
 		set_irq_chip_and_handler_name(irq, &ioapic_chip,
 					 handle_edge_irq, "edge");
-	}
 	set_intr_gate(vector, interrupt[irq]);
 }
 
Index: linux/arch/powerpc/platforms/powermac/pic.c
===================================================================
--- linux.orig/arch/powerpc/platforms/powermac/pic.c
+++ linux/arch/powerpc/platforms/powermac/pic.c
@@ -305,8 +305,6 @@ static int pmac_pic_host_map(struct irq_
 	level = !!(level_mask[hw >> 5] & (1UL << (hw & 0x1f)));
 	if (level)
 		desc->status |= IRQ_LEVEL;
-	else
-		desc->status |= IRQ_DELAYED_DISABLE;
 	set_irq_chip_and_handler(virq, &pmac_pic, level ?
 				 handle_level_irq : handle_edge_irq);
 	return 0;
Index: linux/arch/x86_64/kernel/io_apic.c
===================================================================
--- linux.orig/arch/x86_64/kernel/io_apic.c
+++ linux/arch/x86_64/kernel/io_apic.c
@@ -810,11 +810,9 @@ static void ioapic_register_intr(int irq
 			trigger == IOAPIC_LEVEL)
 		set_irq_chip_and_handler_name(irq, &ioapic_chip,
 					      handle_fasteoi_irq, "fasteoi");
-	else {
-		irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
+	else
 		set_irq_chip_and_handler_name(irq, &ioapic_chip,
 					      handle_edge_irq, "edge");
-	}
 }
 static void __init setup_IO_APIC_irq(int apic, int pin, int idx, int irq)
 {
Index: linux/include/linux/irq.h
===================================================================
--- linux.orig/include/linux/irq.h
+++ linux/include/linux/irq.h
@@ -57,10 +57,9 @@ typedef	void fastcall (*irq_flow_handler
 #define IRQ_NOPROBE		0x00020000	/* IRQ is not valid for probing */
 #define IRQ_NOREQUEST		0x00040000	/* IRQ cannot be requested */
 #define IRQ_NOAUTOEN		0x00080000	/* IRQ will not be enabled on request irq */
-#define IRQ_DELAYED_DISABLE	0x00100000	/* IRQ disable (masking) happens delayed. */
-#define IRQ_WAKEUP		0x00200000	/* IRQ triggers system wakeup */
-#define IRQ_MOVE_PENDING	0x00400000	/* need to re-target IRQ destination */
-#define IRQ_NO_BALANCING	0x00800000	/* IRQ is excluded from balancing */
+#define IRQ_WAKEUP		0x00100000	/* IRQ triggers system wakeup */
+#define IRQ_MOVE_PENDING	0x00200000	/* need to re-target IRQ destination */
+#define IRQ_NO_BALANCING	0x00400000	/* IRQ is excluded from balancing */
 
 #ifdef CONFIG_IRQ_PER_CPU
 # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.20-rc6, Linus Torvalds, (Wed Jan 24, 10:58 pm)
Re: Linux 2.6.20-rc6 - suspend / resume ata_piix, Thomas Gleixner, (Sat Jan 27, 6:11 pm)
Re: Linux 2.6.20-rc6 - suspend / resume ata_piix, Jeff Garzik, (Sat Jan 27, 6:40 pm)
Re: Linux 2.6.20-rc6 - suspend / resume ata_piix, Thomas Gleixner, (Sat Jan 27, 6:44 pm)
Re: Linux 2.6.20-rc6 - suspend / resume ata_piix, Thomas Gleixner, (Sun Jan 28, 6:05 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Sat Jan 27, 4:55 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Stephen Hemminger, (Mon Jan 29, 3:31 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Mon Jan 29, 4:10 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Stephen Hemminger, (Mon Jan 29, 5:38 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Mon Jan 29, 6:23 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Frédéric, (Mon Jan 29, 6:38 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Mon Jan 29, 6:45 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Frédéric, (Mon Jan 29, 6:50 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Mon Jan 29, 6:57 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Frédéric, (Mon Jan 29, 7:26 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Mon Jan 29, 7:37 pm)
[PATCH] block MSI on Sony, Stephen Hemminger, (Mon Jan 29, 7:50 pm)
Re: [PATCH] block MSI on Sony, Thomas Gleixner, (Mon Jan 29, 8:22 pm)
Re: [PATCH] block MSI on Sony, Thomas Gleixner, (Mon Jan 29, 8:26 pm)
Re: [PATCH] block MSI on Sony, Stephen Hemminger, (Mon Jan 29, 8:21 pm)
Re: [PATCH] block MSI on Sony, Thomas Gleixner, (Mon Jan 29, 8:31 pm)
Re: [PATCH] block MSI on Sony, Stephen Hemminger, (Mon Jan 29, 8:31 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Linus Torvalds, (Mon Jan 29, 6:37 pm)
[PATCH] sky2: fix MSI related resume breakage, Thomas Gleixner, (Mon Jan 29, 7:42 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Stephen Hemminger, (Mon Jan 29, 6:40 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Linus Torvalds, (Mon Jan 29, 7:04 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Stephen Hemminger, (Mon Jan 29, 7:45 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Linus Torvalds, (Mon Jan 29, 8:12 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Len Brown, (Tue Jan 30, 4:57 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Pavel Machek, (Thu Feb 1, 8:49 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Rafael J. Wysocki, (Tue Jan 30, 12:01 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Nigel Cunningham, (Tue Jan 30, 5:28 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Stephen Hemminger, (Mon Jan 29, 8:16 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Linus Torvalds, (Mon Jan 29, 8:25 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Ingo Molnar, (Tue Jan 30, 2:54 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Jeff Garzik, (Tue Jan 30, 3:39 am)
[LIBATA BUG] sr.c: TEST_UNIT_READY error, Conke Hu, (Thu Feb 1, 2:15 am)
Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error, Jeff Garzik, (Wed Feb 7, 8:40 am)
Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error, Conke Hu, (Fri Feb 2, 1:48 am)
Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error, Conke Hu, (Tue Feb 13, 3:30 am)
Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error, Conke Hu, (Thu Feb 15, 2:30 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Ingo Molnar, (Tue Jan 30, 4:03 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Ingo Molnar, (Tue Jan 30, 3:53 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Jeff Garzik, (Tue Jan 30, 4:02 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Ingo Molnar, (Tue Jan 30, 4:08 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Jeff Garzik, (Wed Jan 31, 11:27 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Ingo Molnar, (Wed Jan 31, 1:38 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Jeff Garzik, (Wed Jan 31, 1:52 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Wed Jan 31, 4:13 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Ingo Molnar, (Tue Jan 30, 4:13 am)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Stephen Hemminger, (Mon Jan 29, 8:26 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Stephen Hemminger, (Mon Jan 29, 6:23 pm)
Re: Linux 2.6.20-rc6 - sky2 resume breakage, Thomas Gleixner, (Mon Jan 29, 6:31 pm)
Re: Linux 2.6.20-rc6 - supend lockdep warning, Thomas Gleixner, (Sat Jan 27, 4:47 pm)
2.6.20-rc6: known regressions with patches (v2), Adrian Bunk, (Sat Jan 27, 1:44 pm)
2.6.20-rc6: known unfixed regressions (v2) (part 2), Adrian Bunk, (Sat Jan 27, 1:42 pm)
Re: 2.6.20-rc6: known unfixed regressions (v2) (part 2), Mike Galbraith, (Mon Jan 29, 2:26 am)
Re: 2.6.20-rc6: known unfixed regressions (v2) (part 2), Andrew Morton, (Mon Jan 29, 2:48 am)
Re: 2.6.20-rc6: known unfixed regressions (v2) (part 2), Mike Galbraith, (Mon Jan 29, 3:08 am)
Re: 2.6.20-rc6: known unfixed regressions (v2) (part 2), Linus Torvalds, (Mon Jan 29, 3:13 am)
2.6.20-rc6: known unfixed regressions (v2) (part 1), Adrian Bunk, (Sat Jan 27, 1:32 pm)
Re: Linux 2.6.20-rc6, Sunil Naidu, (Thu Jan 25, 6:09 am)
Re: Linux 2.6.20-rc6, Michal Piotrowski, (Thu Jan 25, 5:05 pm)
Re: Linux 2.6.20-rc6, David Miller, (Thu Jan 25, 5:12 pm)
RE: Linux 2.6.20-rc6, Venkat Yekkirala, (Fri Jan 26, 12:52 pm)
Re: Linux 2.6.20-rc6 - build failure, Eyal Lebedinsky, (Thu Jan 25, 7:10 am)
Re: Linux 2.6.20-rc6 - build failure, Eyal Lebedinsky, (Thu Jan 25, 10:22 pm)
[2.6 patch] fix OCFS2 compile error, Adrian Bunk, (Fri Jan 26, 2:49 pm)
Re: [2.6 patch] fix OCFS2 compile error, Mark Fasheh, (Fri Jan 26, 3:47 pm)
Re: [2.6 patch] fix OCFS2 compile error, Adrian Bunk, (Fri Jan 26, 3:53 pm)
Re: Linux 2.6.20-rc6 - build failure, Mark Fasheh, (Fri Jan 26, 2:46 pm)
2.6.20-rc6: known regressions with patches, Adrian Bunk, (Fri Jan 26, 2:18 pm)
Re: 2.6.20-rc6: known regressions with patches, Ingo Molnar, (Mon Jan 29, 4:45 am)
Re: 2.6.20-rc6: known regressions with patches, Dave Jones, (Mon Jan 29, 8:58 am)
2.6.20-rc6: known unfixed regressions (part 2), Adrian Bunk, (Fri Jan 26, 2:11 pm)
Re: 2.6.20-rc6: known unfixed regressions (part 2), Michal Piotrowski, (Fri Jan 26, 3:04 pm)
RE: 2.6.20-rc6: known unfixed regressions (part 2), Venkat Yekkirala, (Fri Jan 26, 3:08 pm)
Re: 2.6.20-rc6: known unfixed regressions (part 2), Adrian Bunk, (Sat Jan 27, 1:28 pm)
Re: 2.6.20-rc6: known unfixed regressions (part 2), Linus Torvalds, (Sat Jan 27, 1:58 pm)
Re: 2.6.20-rc6: known unfixed regressions (part 2), Adrian Bunk, (Sat Jan 27, 1:39 pm)
2.6.20-rc6: known unfixed regressions (part 1), Adrian Bunk, (Fri Jan 26, 2:10 pm)
Re: Linux 2.6.20-rc6, Arkadiusz Patyk, (Thu Jan 25, 1:50 pm)
speck-geostationary