public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg59@srcf.ucam.org>
To: Andi Kleen <ak@suse.de>
Cc: Pavel Machek <pavel@ucw.cz>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [PATCH] - restore i8259A eoi status on resume
Date: Tue, 12 Sep 2006 00:07:45 +0100	[thread overview]
Message-ID: <20060911230745.GA24001@srcf.ucam.org> (raw)
In-Reply-To: <20060911222351.GA23679@srcf.ucam.org>

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

  reply	other threads:[~2006-09-11 23:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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                 ` Matthew Garrett [this message]
2006-09-12  9:19                   ` [PATCH] - restore i8259A eoi status on resume Pavel Machek
2006-09-12 12:47                     ` Matthew Garrett
2006-09-12 12:11                       ` Andi Kleen
2006-09-12 13:40                         ` Matthew Garrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060911230745.GA24001@srcf.ucam.org \
    --to=mjg59@srcf.ucam.org \
    --cc=ak@suse.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox