Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75068
b: refs/heads/master
c: 4aae070
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Dec 18, 2007
1 parent 7314ca5 commit a7e596b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 971e5b35fb02c5088d49e6c024aab73582a35b71
refs/heads/master: 4aae07025265151e3f7041dfbf0f529e122de1d8
16 changes: 12 additions & 4 deletions trunk/arch/x86/kernel/io_apic_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,13 +1882,16 @@ __setup("no_timer_check", notimercheck);
static int __init timer_irq_works(void)
{
unsigned long t1 = jiffies;
unsigned long flags;

if (no_timer_check)
return 1;

local_save_flags(flags);
local_irq_enable();
/* Let ten ticks pass... */
mdelay((10 * 1000) / HZ);
local_irq_restore(flags);

/*
* Expect a few ticks at least, to be sure some possible
Expand Down Expand Up @@ -2167,6 +2170,9 @@ static inline void __init check_timer(void)
int apic1, pin1, apic2, pin2;
int vector;
unsigned int ver;
unsigned long flags;

local_irq_save(flags);

ver = apic_read(APIC_LVR);
ver = GET_APIC_VERSION(ver);
Expand Down Expand Up @@ -2219,7 +2225,7 @@ static inline void __init check_timer(void)
}
if (disable_timer_pin_1 > 0)
clear_IO_APIC_pin(0, pin1);
return;
goto out;
}
clear_IO_APIC_pin(apic1, pin1);
printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
Expand All @@ -2242,7 +2248,7 @@ static inline void __init check_timer(void)
if (nmi_watchdog == NMI_IO_APIC) {
setup_nmi();
}
return;
goto out;
}
/*
* Cleanup, just in case ...
Expand All @@ -2266,7 +2272,7 @@ static inline void __init check_timer(void)

if (timer_irq_works()) {
printk(" works.\n");
return;
goto out;
}
apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
printk(" failed.\n");
Expand All @@ -2282,11 +2288,13 @@ static inline void __init check_timer(void)

if (timer_irq_works()) {
printk(" works.\n");
return;
goto out;
}
printk(" failed :(.\n");
panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a "
"report. Then try booting with the 'noapic' option");
out:
local_irq_restore(flags);
}

/*
Expand Down
16 changes: 12 additions & 4 deletions trunk/arch/x86/kernel/io_apic_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,13 @@ void disable_IO_APIC(void)
static int __init timer_irq_works(void)
{
unsigned long t1 = jiffies;
unsigned long flags;

local_save_flags(flags);
local_irq_enable();
/* Let ten ticks pass... */
mdelay((10 * 1000) / HZ);
local_irq_restore(flags);

/*
* Expect a few ticks at least, to be sure some possible
Expand Down Expand Up @@ -1655,6 +1658,9 @@ static inline void check_timer(void)
{
struct irq_cfg *cfg = irq_cfg + 0;
int apic1, pin1, apic2, pin2;
unsigned long flags;

local_irq_save(flags);

/*
* get/set the timer IRQ vector:
Expand Down Expand Up @@ -1696,7 +1702,7 @@ static inline void check_timer(void)
}
if (disable_timer_pin_1 > 0)
clear_IO_APIC_pin(0, pin1);
return;
goto out;
}
clear_IO_APIC_pin(apic1, pin1);
apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not "
Expand All @@ -1718,7 +1724,7 @@ static inline void check_timer(void)
if (nmi_watchdog == NMI_IO_APIC) {
setup_nmi();
}
return;
goto out;
}
/*
* Cleanup, just in case ...
Expand All @@ -1741,7 +1747,7 @@ static inline void check_timer(void)

if (timer_irq_works()) {
apic_printk(APIC_VERBOSE," works.\n");
return;
goto out;
}
apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector);
apic_printk(APIC_VERBOSE," failed.\n");
Expand All @@ -1756,10 +1762,12 @@ static inline void check_timer(void)

if (timer_irq_works()) {
apic_printk(APIC_VERBOSE," works.\n");
return;
goto out;
}
apic_printk(APIC_VERBOSE," failed :(.\n");
panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n");
out:
local_irq_restore(flags);
}

static int __init notimercheck(char *s)
Expand Down

0 comments on commit a7e596b

Please sign in to comment.