diff options
author | Matthew Garrett <mjg59@srcf.ucam.org> | 2006-09-26 04:52:41 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:41 -0400 |
commit | 35d534a3ff4905c0a7bddbad0fc9df55967742c7 (patch) | |
tree | b926186d52d0b98f2931e7ad59ec6aefd2e5c641 /arch | |
parent | f354b3a92af9b132b188b9c8ebbfb74de699926d (diff) |
[PATCH] x86: - 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.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/i8259.c | 6 | ||||
-rw-r--r-- | arch/x86_64/kernel/i8259.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index d4756d154f47..ea5f4e7958d8 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c | |||
@@ -45,6 +45,8 @@ static void end_8259A_irq (unsigned int irq) | |||
45 | 45 | ||
46 | #define shutdown_8259A_irq disable_8259A_irq | 46 | #define shutdown_8259A_irq disable_8259A_irq |
47 | 47 | ||
48 | static int i8259A_auto_eoi; | ||
49 | |||
48 | static void mask_and_ack_8259A(unsigned int); | 50 | static void mask_and_ack_8259A(unsigned int); |
49 | 51 | ||
50 | unsigned int startup_8259A_irq(unsigned int irq) | 52 | unsigned int startup_8259A_irq(unsigned int irq) |
@@ -253,7 +255,7 @@ static void save_ELCR(char *trigger) | |||
253 | 255 | ||
254 | static int i8259A_resume(struct sys_device *dev) | 256 | static int i8259A_resume(struct sys_device *dev) |
255 | { | 257 | { |
256 | init_8259A(0); | 258 | init_8259A(i8259A_auto_eoi); |
257 | restore_ELCR(irq_trigger); | 259 | restore_ELCR(irq_trigger); |
258 | return 0; | 260 | return 0; |
259 | } | 261 | } |
@@ -301,6 +303,8 @@ void init_8259A(int auto_eoi) | |||
301 | { | 303 | { |
302 | unsigned long flags; | 304 | unsigned long flags; |
303 | 305 | ||
306 | i8259A_auto_eoi = auto_eoi; | ||
307 | |||
304 | spin_lock_irqsave(&i8259A_lock, flags); | 308 | spin_lock_irqsave(&i8259A_lock, flags); |
305 | 309 | ||
306 | outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ | 310 | 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 d2f5acde5749..2dd51f364ea2 100644 --- a/arch/x86_64/kernel/i8259.c +++ b/arch/x86_64/kernel/i8259.c | |||
@@ -123,6 +123,8 @@ void (*interrupt[NR_IRQS])(void) = { | |||
123 | 123 | ||
124 | DEFINE_SPINLOCK(i8259A_lock); | 124 | DEFINE_SPINLOCK(i8259A_lock); |
125 | 125 | ||
126 | static int i8259A_auto_eoi; | ||
127 | |||
126 | static void end_8259A_irq (unsigned int irq) | 128 | static void end_8259A_irq (unsigned int irq) |
127 | { | 129 | { |
128 | if (irq > 256) { | 130 | if (irq > 256) { |
@@ -336,6 +338,8 @@ void init_8259A(int auto_eoi) | |||
336 | { | 338 | { |
337 | unsigned long flags; | 339 | unsigned long flags; |
338 | 340 | ||
341 | i8259A_auto_eoi = auto_eoi; | ||
342 | |||
339 | spin_lock_irqsave(&i8259A_lock, flags); | 343 | spin_lock_irqsave(&i8259A_lock, flags); |
340 | 344 | ||
341 | outb(0xff, 0x21); /* mask all of 8259A-1 */ | 345 | outb(0xff, 0x21); /* mask all of 8259A-1 */ |
@@ -394,7 +398,7 @@ static void save_ELCR(char *trigger) | |||
394 | 398 | ||
395 | static int i8259A_resume(struct sys_device *dev) | 399 | static int i8259A_resume(struct sys_device *dev) |
396 | { | 400 | { |
397 | init_8259A(0); | 401 | init_8259A(i8259A_auto_eoi); |
398 | restore_ELCR(irq_trigger); | 402 | restore_ELCR(irq_trigger); |
399 | return 0; | 403 | return 0; |
400 | } | 404 | } |