Skip to content

Commit

Permalink
[PATCH] x86: - restore i8259A eoi status on resume
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Garrett authored and Andi Kleen committed Sep 26, 2006
1 parent f354b3a commit 35d534a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion arch/i386/kernel/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ static void end_8259A_irq (unsigned int irq)

#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)
Expand Down Expand Up @@ -253,7 +255,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;
}
Expand Down Expand Up @@ -301,6 +303,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 */
Expand Down
6 changes: 5 additions & 1 deletion arch/x86_64/kernel/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ void (*interrupt[NR_IRQS])(void) = {

DEFINE_SPINLOCK(i8259A_lock);

static int i8259A_auto_eoi;

static void end_8259A_irq (unsigned int irq)
{
if (irq > 256) {
Expand Down Expand Up @@ -336,6 +338,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 */
Expand Down Expand Up @@ -394,7 +398,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;
}
Expand Down

0 comments on commit 35d534a

Please sign in to comment.