Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23835
b: refs/heads/master
c: da7ed9f
h: refs/heads/master
i:
  23833: a4de454
  23831: 381b9b6
v: v3
  • Loading branch information
Vivek Goyal authored and Linus Torvalds committed Mar 25, 2006
1 parent 0314997 commit 419533f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1fc513d81b0f50f9543428ce95ec63ae70ab184
refs/heads/master: da7ed9f98f6f3f18664f8ab24303f9428b9d78f8
20 changes: 20 additions & 0 deletions trunk/arch/x86_64/kernel/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ void __init init_bsp_APIC(void)
void __cpuinit setup_local_APIC (void)
{
unsigned int value, maxlvt;
int i, j;

value = apic_read(APIC_LVR);

Expand Down Expand Up @@ -370,6 +371,25 @@ void __cpuinit setup_local_APIC (void)
value &= ~APIC_TPRI_MASK;
apic_write(APIC_TASKPRI, value);

/*
* After a crash, we no longer service the interrupts and a pending
* interrupt from previous kernel might still have ISR bit set.
*
* Most probably by now CPU has serviced that pending interrupt and
* it might not have done the ack_APIC_irq() because it thought,
* interrupt came from i8259 as ExtInt. LAPIC did not get EOI so it
* does not clear the ISR bit and cpu thinks it has already serivced
* the interrupt. Hence a vector might get locked. It was noticed
* for timer irq (vector 0x31). Issue an extra EOI to clear ISR.
*/
for (i = APIC_ISR_NR - 1; i >= 0; i--) {
value = apic_read(APIC_ISR + i*0x10);
for (j = 31; j >= 0; j--) {
if (value & (1<<j))
ack_APIC_irq();
}
}

/*
* Now that we are all set up, enable the APIC
*/
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86_64/apicdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define APIC_SPIV_FOCUS_DISABLED (1<<9)
#define APIC_SPIV_APIC_ENABLED (1<<8)
#define APIC_ISR 0x100
#define APIC_ISR_NR 0x8 /* Number of 32 bit ISR registers. */
#define APIC_TMR 0x180
#define APIC_IRR 0x200
#define APIC_ESR 0x280
Expand Down

0 comments on commit 419533f

Please sign in to comment.