Skip to contentSkip to conversation

io-apic breaks suspend unless acpi_skip_timer_override

PATCH In review Matthew Garrett 3 participants 14 messages Sep 10, 2006 – Sep 12, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

ACPI suspend/resume fails on my HP nx6125 unless I either:

a) boot with noapic, or
b) boot with acpi_skip_timer_override

Does anyone have the faintest idea how to debug this?

Signature · 1 line
Matthew Garrett | [email protected]
#1 lore raw
Quoted 6 lines · Matthew Garrett

ACPI suspend/resume fails on my HP nx6125 unless I either:

a) boot with noapic, or
b) boot with acpi_skip_timer_override

Does anyone have the faintest idea how to debug this?

Do you mean suspend-to-RAM? Can you try beeping patch?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
Quoted 1 line · Pavel Machek

Do you mean suspend-to-RAM? Can you try beeping patch?

Yes, suspend to RAM. I'll look at trying to work out where it blows up, though I suspect it's successfully getting back into C code.

Signature · 1 line
Matthew Garrett | [email protected]
#3 lore raw
Quoted 6 lines · Matthew Garrett
Quoted 1 line · Pavel Machek

Do you mean suspend-to-RAM? Can you try beeping patch?

Yes, suspend to RAM. I'll look at trying to work out where it blows up, though I suspect it's successfully getting back into C code.

If you are back in C, that should be easy. Just serial console or something... :-).
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

io-apic - no timer ticks after resume on IXP200

(Cc:ing Andi because I seem to remember him reworking the code for this chipset)

Got it. After a suspend/resume cycle, I no longer have any timer ticks. Unsurprisingly, this breaks things. This is even true if I stub out the actual suspend code - that is, simply calling the device suspend and resume methods fails to set up the timer again properly.

So the situation is the following: without acpi_skip_timer_override, the system works fine until suspend/resume. At that point, I no longer get any timer ticks. With acpi_skip_timer_override, the timer works fine before and after suspend. I suspect that something in the apic suspend/resume code isn't setting things correctly? Is there any useful debug output I can provide?

Signature · 1 line
Matthew Garrett | [email protected]
#5 lore raw

Re: io-apic - no timer ticks after resume on IXP200

Quoted 2 lines · Matthew Garrett

(Cc:ing Andi because I seem to remember him reworking the code for this chipset)

You forgot to mention on which kernel version you're seeing this? In particular did it work in some kernel version and then stop in another?

BTW here suspend/resume works fine on a IXP200, so it's something specific to your board.

-Andi

#6 lore raw

Re: io-apic - no timer ticks after resume on IXP200

Quoted 2 lines · Andi Kleen

You forgot to mention on which kernel version you're seeing this? In particular did it work in some kernel version and then stop in another?

Oops, sorry. I'm using 2.6.17.11, but the problem appears to persist in the latest 2.6.18-rc. Does your board have a timer override?

Signature · 1 line
Matthew Garrett | [email protected]
#7 lore raw

Re: io-apic - no timer ticks after resume on IXP200

Quoted 7 lines · Matthew Garrett
Quoted 3 lines · Andi Kleen

You forgot to mention on which kernel version you're seeing this? In particular did it work in some kernel version and then stop in another?

Oops, sorry. I'm using 2.6.17.11, but the problem appears to persist in the latest 2.6.18-rc.

And did it work with a earlier kernel?

-Andi

#8 lore raw

Re: io-apic - no timer ticks after resume on IXP200

Quoted 1 line · Andi Kleen

And did it work with a earlier kernel?

No. It works if I hack a call to check_timer into the resume code - I'm working through that now to figure out which bit is necessary.

Signature · 1 line
Matthew Garrett | [email protected]
#9 lore raw

PATCH 1/1 - restore i8259A eoi status on resume

Got it. i8259A_resume calls init_8259A(0) unconditionally, even if auto_eoi has been set. Keep track of the current status and restore that on resume. This fixes it for AMD64 and i386.

arch/i386/kernel/i8259.c +5 -1
index 323ef8a..41485c7 100644
@@ -46,6 +46,8 @@ static void end_8259A_irq (unsigned int 
 
 #define shutdown_8259A_irq	disable_8259A_irq
 
+static int i8259A_auto_eoi;
+
 static void mask_and_ack_8259A(unsigned int);
 
 unsigned int startup_8259A_irq(unsigned int irq)
@@ -254,7 +256,7 @@ static void save_ELCR(char *trigger)
 
 static int i8259A_resume(struct sys_device *dev)
 {
-	init_8259A(0);
+	init_8259A(i8259A_auto_eoi);
 	restore_ELCR(irq_trigger);
 	return 0;
 }
@@ -302,6 +304,8 @@ void init_8259A(int auto_eoi)
 {
 	unsigned long flags;
 
+	i8259A_auto_eoi = auto_eoi;
+	
 	spin_lock_irqsave(&i8259A_lock, flags);
 
 	outb(0xff, PIC_MASTER_IMR);	/* mask all of 8259A-1 */
arch/x86_64/kernel/i8259.c +5 -1
index 5ecd34a..75f77da 100644
@@ -129,6 +129,8 @@ #undef IRQLIST_14
 
 DEFINE_SPINLOCK(i8259A_lock);
 
+static int i8259A_auto_eoi;
+
 static void end_8259A_irq (unsigned int irq)
 {
 	if (irq > 256) { 
@@ -342,6 +344,8 @@ void init_8259A(int auto_eoi)
 {
 	unsigned long flags;
 
+	i8259A_auto_eoi = auto_eoi;
+
 	spin_lock_irqsave(&i8259A_lock, flags);
 
 	outb(0xff, 0x21);	/* mask all of 8259A-1 */
@@ -400,7 +404,7 @@ static void save_ELCR(char *trigger)
 
 static int i8259A_resume(struct sys_device *dev)
 {
-	init_8259A(0);
+	init_8259A(i8259A_auto_eoi);
 	restore_ELCR(irq_trigger);
 	return 0;
 }
Signature · 1 line
Matthew Garrett | [email protected]
#10 lore raw

Re: [PATCH] - restore i8259A eoi status on resume

Hi!

Quoted 3 lines

Got it. i8259A_resume calls init_8259A(0) unconditionally, even if auto_eoi has been set. Keep track of the current status and restore that on resume. This fixes it for AMD64 and i386.

Patch looks okay to me...
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#11 lore raw

Re: [PATCH] - restore i8259A eoi status on resume

Quoted 7 lines · Pavel Machek

Hi!

Quoted 3 lines

Got it. i8259A_resume calls init_8259A(0) unconditionally, even if auto_eoi has been set. Keep track of the current status and restore that on resume. This fixes it for AMD64 and i386.

Patch looks okay to me...

Cool. Andi, does it look sane to you? I'm not really sure who to wave 8259 code at...

Signature · 1 line
Matthew Garrett | [email protected]
#12 lore raw

Re: [PATCH] - restore i8259A eoi status on resume

Quoted 11 lines · Matthew Garrett
Quoted 7 lines · Pavel Machek

Hi!

Quoted 3 lines

Got it. i8259A_resume calls init_8259A(0) unconditionally, even if auto_eoi has been set. Keep track of the current status and restore that on resume. This fixes it for AMD64 and i386.

Patch looks okay to me...

Cool. Andi, does it look sane to you? I'm not really sure who to wave 8259 code at...

Yes. I already have it queued for .19 at least. Not sure it's critical enough for .18, especially since it doesn't seem to be a regression.

-Andi

#13 lore raw

Re: [PATCH] - restore i8259A eoi status on resume

Quoted 2 lines · Andi Kleen

Yes. I already have it queued for .19 at least. Not sure it's critical enough for .18, especially since it doesn't seem to be a regression.

Yeah, I'd tend to agree.

Signature · 1 line
Matthew Garrett | [email protected]