LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* io-apic breaks suspend unless acpi_skip_timer_override
@ 2006-09-10 14:15 Matthew Garrett
  2006-09-10 20:58 ` Pavel Machek
  0 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2006-09-10 14:15 UTC (permalink / raw)
  To: linux-kernel, linux-acpi

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?

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: io-apic breaks suspend unless acpi_skip_timer_override
  2006-09-10 14:15 io-apic breaks suspend unless acpi_skip_timer_override Matthew Garrett
@ 2006-09-10 20:58 ` Pavel Machek
  2006-09-10 21:20   ` Matthew Garrett
  0 siblings, 1 reply; 14+ messages in thread
From: Pavel Machek @ 2006-09-10 20:58 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, linux-acpi

On Sun 2006-09-10 15:15:34, Matthew Garrett wrote:
> 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: io-apic breaks suspend unless acpi_skip_timer_override
  2006-09-10 20:58 ` Pavel Machek
@ 2006-09-10 21:20   ` Matthew Garrett
  2006-09-10 22:33     ` Pavel Machek
  0 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2006-09-10 21:20 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel, linux-acpi

On Sun, Sep 10, 2006 at 10:58:03PM +0200, Pavel Machek wrote:

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

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: io-apic breaks suspend unless acpi_skip_timer_override
  2006-09-10 21:20   ` Matthew Garrett
@ 2006-09-10 22:33     ` Pavel Machek
  2006-09-11  0:31       ` io-apic - no timer ticks after resume on IXP200 Matthew Garrett
  0 siblings, 1 reply; 14+ messages in thread
From: Pavel Machek @ 2006-09-10 22:33 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, linux-acpi

On Sun 2006-09-10 22:20:45, Matthew Garrett wrote:
> On Sun, Sep 10, 2006 at 10:58:03PM +0200, Pavel Machek wrote:
> 
> > 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* io-apic - no timer ticks after resume on IXP200
  2006-09-10 22:33     ` Pavel Machek
@ 2006-09-11  0:31       ` Matthew Garrett
  2006-09-11  5:46         ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2006-09-11  0:31 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel, linux-acpi, ak

(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?
-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: io-apic - no timer ticks after resume on IXP200
  2006-09-11  0:31       ` io-apic - no timer ticks after resume on IXP200 Matthew Garrett
@ 2006-09-11  5:46         ` Andi Kleen
  2006-09-11 11:05           ` Matthew Garrett
  0 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2006-09-11  5:46 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Pavel Machek, linux-kernel, linux-acpi

On Monday 11 September 2006 02:31, Matthew Garrett wrote:
> (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

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

* Re: io-apic - no timer ticks after resume on IXP200
  2006-09-11  5:46         ` Andi Kleen
@ 2006-09-11 11:05           ` Matthew Garrett
  2006-09-11 20:02             ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2006-09-11 11:05 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Pavel Machek, linux-kernel, linux-acpi

On Mon, Sep 11, 2006 at 07:46:58AM +0200, Andi Kleen wrote:

> 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?
-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: io-apic - no timer ticks after resume on IXP200
  2006-09-11 11:05           ` Matthew Garrett
@ 2006-09-11 20:02             ` Andi Kleen
  2006-09-11 22:23               ` Matthew Garrett
  0 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2006-09-11 20:02 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Pavel Machek, linux-kernel, linux-acpi

On Monday 11 September 2006 13:05, Matthew Garrett wrote:
> On Mon, Sep 11, 2006 at 07:46:58AM +0200, Andi Kleen wrote:
> > 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


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

* Re: io-apic - no timer ticks after resume on IXP200
  2006-09-11 20:02             ` Andi Kleen
@ 2006-09-11 22:23               ` Matthew Garrett
  2006-09-11 23:07                 ` [PATCH] - restore i8259A eoi status on resume Matthew Garrett
  0 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2006-09-11 22:23 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Pavel Machek, linux-kernel, linux-acpi

On Mon, Sep 11, 2006 at 10:02:50PM +0200, Andi Kleen wrote:

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

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* [PATCH] - restore i8259A eoi status on resume
  2006-09-11 22:23               ` Matthew Garrett
@ 2006-09-11 23:07                 ` Matthew Garrett
  2006-09-12  9:19                   ` Pavel Machek
  0 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2006-09-11 23:07 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Pavel Machek, linux-kernel, linux-acpi

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.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>

diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c
index 323ef8a..41485c7 100644
--- a/arch/i386/kernel/i8259.c
+++ b/arch/i386/kernel/i8259.c
@@ -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 */
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index 5ecd34a..75f77da 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -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;
 }


-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH] - restore i8259A eoi status on resume
  2006-09-11 23:07                 ` [PATCH] - restore i8259A eoi status on resume Matthew Garrett
@ 2006-09-12  9:19                   ` Pavel Machek
  2006-09-12 12:47                     ` Matthew Garrett
  0 siblings, 1 reply; 14+ messages in thread
From: Pavel Machek @ 2006-09-12  9:19 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Andi Kleen, linux-kernel, linux-acpi

Hi!

> 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH] - restore i8259A eoi status on resume
  2006-09-12 12:47                     ` Matthew Garrett
@ 2006-09-12 12:11                       ` Andi Kleen
  2006-09-12 13:40                         ` Matthew Garrett
  0 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2006-09-12 12:11 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Pavel Machek, linux-kernel, linux-acpi

On Tuesday 12 September 2006 14:47, Matthew Garrett wrote:
> On Tue, Sep 12, 2006 at 11:19:06AM +0200, Pavel Machek wrote:
> > Hi!
> >
> > > 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

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

* Re: [PATCH] - restore i8259A eoi status on resume
  2006-09-12  9:19                   ` Pavel Machek
@ 2006-09-12 12:47                     ` Matthew Garrett
  2006-09-12 12:11                       ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2006-09-12 12:47 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andi Kleen, linux-kernel, linux-acpi

On Tue, Sep 12, 2006 at 11:19:06AM +0200, Pavel Machek wrote:
> Hi!
> 
> > 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...

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH] - restore i8259A eoi status on resume
  2006-09-12 12:11                       ` Andi Kleen
@ 2006-09-12 13:40                         ` Matthew Garrett
  0 siblings, 0 replies; 14+ messages in thread
From: Matthew Garrett @ 2006-09-12 13:40 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Pavel Machek, linux-kernel, linux-acpi

On Tue, Sep 12, 2006 at 02:11:36PM +0200, Andi Kleen wrote:

> 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.
-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

end of thread, other threads:[~2006-09-12 13:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-10 14:15 io-apic breaks suspend unless acpi_skip_timer_override Matthew Garrett
2006-09-10 20:58 ` Pavel Machek
2006-09-10 21:20   ` Matthew Garrett
2006-09-10 22:33     ` Pavel Machek
2006-09-11  0:31       ` io-apic - no timer ticks after resume on IXP200 Matthew Garrett
2006-09-11  5:46         ` Andi Kleen
2006-09-11 11:05           ` Matthew Garrett
2006-09-11 20:02             ` Andi Kleen
2006-09-11 22:23               ` Matthew Garrett
2006-09-11 23:07                 ` [PATCH] - restore i8259A eoi status on resume Matthew Garrett
2006-09-12  9:19                   ` Pavel Machek
2006-09-12 12:47                     ` Matthew Garrett
2006-09-12 12:11                       ` Andi Kleen
2006-09-12 13:40                         ` Matthew Garrett

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