aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/io_apic_32.c16
-rw-r--r--arch/x86/kernel/io_apic_64.c16
2 files changed, 24 insertions, 8 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 6cf27319a91c..c3a565bba106 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -1882,13 +1882,16 @@ __setup("no_timer_check", notimercheck);
1882static int __init timer_irq_works(void) 1882static int __init timer_irq_works(void)
1883{ 1883{
1884 unsigned long t1 = jiffies; 1884 unsigned long t1 = jiffies;
1885 unsigned long flags;
1885 1886
1886 if (no_timer_check) 1887 if (no_timer_check)
1887 return 1; 1888 return 1;
1888 1889
1890 local_save_flags(flags);
1889 local_irq_enable(); 1891 local_irq_enable();
1890 /* Let ten ticks pass... */ 1892 /* Let ten ticks pass... */
1891 mdelay((10 * 1000) / HZ); 1893 mdelay((10 * 1000) / HZ);
1894 local_irq_restore(flags);
1892 1895
1893 /* 1896 /*
1894 * Expect a few ticks at least, to be sure some possible 1897 * Expect a few ticks at least, to be sure some possible
@@ -2167,6 +2170,9 @@ static inline void __init check_timer(void)
2167 int apic1, pin1, apic2, pin2; 2170 int apic1, pin1, apic2, pin2;
2168 int vector; 2171 int vector;
2169 unsigned int ver; 2172 unsigned int ver;
2173 unsigned long flags;
2174
2175 local_irq_save(flags);
2170 2176
2171 ver = apic_read(APIC_LVR); 2177 ver = apic_read(APIC_LVR);
2172 ver = GET_APIC_VERSION(ver); 2178 ver = GET_APIC_VERSION(ver);
@@ -2219,7 +2225,7 @@ static inline void __init check_timer(void)
2219 } 2225 }
2220 if (disable_timer_pin_1 > 0) 2226 if (disable_timer_pin_1 > 0)
2221 clear_IO_APIC_pin(0, pin1); 2227 clear_IO_APIC_pin(0, pin1);
2222 return; 2228 goto out;
2223 } 2229 }
2224 clear_IO_APIC_pin(apic1, pin1); 2230 clear_IO_APIC_pin(apic1, pin1);
2225 printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to " 2231 printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
@@ -2242,7 +2248,7 @@ static inline void __init check_timer(void)
2242 if (nmi_watchdog == NMI_IO_APIC) { 2248 if (nmi_watchdog == NMI_IO_APIC) {
2243 setup_nmi(); 2249 setup_nmi();
2244 } 2250 }
2245 return; 2251 goto out;
2246 } 2252 }
2247 /* 2253 /*
2248 * Cleanup, just in case ... 2254 * Cleanup, just in case ...
@@ -2266,7 +2272,7 @@ static inline void __init check_timer(void)
2266 2272
2267 if (timer_irq_works()) { 2273 if (timer_irq_works()) {
2268 printk(" works.\n"); 2274 printk(" works.\n");
2269 return; 2275 goto out;
2270 } 2276 }
2271 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector); 2277 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
2272 printk(" failed.\n"); 2278 printk(" failed.\n");
@@ -2282,11 +2288,13 @@ static inline void __init check_timer(void)
2282 2288
2283 if (timer_irq_works()) { 2289 if (timer_irq_works()) {
2284 printk(" works.\n"); 2290 printk(" works.\n");
2285 return; 2291 goto out;
2286 } 2292 }
2287 printk(" failed :(.\n"); 2293 printk(" failed :(.\n");
2288 panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a " 2294 panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a "
2289 "report. Then try booting with the 'noapic' option"); 2295 "report. Then try booting with the 'noapic' option");
2296out:
2297 local_irq_restore(flags);
2290} 2298}
2291 2299
2292/* 2300/*
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
index 435a8c9b55f8..cbac1670c7c3 100644
--- a/arch/x86/kernel/io_apic_64.c
+++ b/arch/x86/kernel/io_apic_64.c
@@ -1281,10 +1281,13 @@ void disable_IO_APIC(void)
1281static int __init timer_irq_works(void) 1281static int __init timer_irq_works(void)
1282{ 1282{
1283 unsigned long t1 = jiffies; 1283 unsigned long t1 = jiffies;
1284 unsigned long flags;
1284 1285
1286 local_save_flags(flags);
1285 local_irq_enable(); 1287 local_irq_enable();
1286 /* Let ten ticks pass... */ 1288 /* Let ten ticks pass... */
1287 mdelay((10 * 1000) / HZ); 1289 mdelay((10 * 1000) / HZ);
1290 local_irq_restore(flags);
1288 1291
1289 /* 1292 /*
1290 * Expect a few ticks at least, to be sure some possible 1293 * Expect a few ticks at least, to be sure some possible
@@ -1655,6 +1658,9 @@ static inline void check_timer(void)
1655{ 1658{
1656 struct irq_cfg *cfg = irq_cfg + 0; 1659 struct irq_cfg *cfg = irq_cfg + 0;
1657 int apic1, pin1, apic2, pin2; 1660 int apic1, pin1, apic2, pin2;
1661 unsigned long flags;
1662
1663 local_irq_save(flags);
1658 1664
1659 /* 1665 /*
1660 * get/set the timer IRQ vector: 1666 * get/set the timer IRQ vector:
@@ -1696,7 +1702,7 @@ static inline void check_timer(void)
1696 } 1702 }
1697 if (disable_timer_pin_1 > 0) 1703 if (disable_timer_pin_1 > 0)
1698 clear_IO_APIC_pin(0, pin1); 1704 clear_IO_APIC_pin(0, pin1);
1699 return; 1705 goto out;
1700 } 1706 }
1701 clear_IO_APIC_pin(apic1, pin1); 1707 clear_IO_APIC_pin(apic1, pin1);
1702 apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not " 1708 apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not "
@@ -1718,7 +1724,7 @@ static inline void check_timer(void)
1718 if (nmi_watchdog == NMI_IO_APIC) { 1724 if (nmi_watchdog == NMI_IO_APIC) {
1719 setup_nmi(); 1725 setup_nmi();
1720 } 1726 }
1721 return; 1727 goto out;
1722 } 1728 }
1723 /* 1729 /*
1724 * Cleanup, just in case ... 1730 * Cleanup, just in case ...
@@ -1741,7 +1747,7 @@ static inline void check_timer(void)
1741 1747
1742 if (timer_irq_works()) { 1748 if (timer_irq_works()) {
1743 apic_printk(APIC_VERBOSE," works.\n"); 1749 apic_printk(APIC_VERBOSE," works.\n");
1744 return; 1750 goto out;
1745 } 1751 }
1746 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector); 1752 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector);
1747 apic_printk(APIC_VERBOSE," failed.\n"); 1753 apic_printk(APIC_VERBOSE," failed.\n");
@@ -1756,10 +1762,12 @@ static inline void check_timer(void)
1756 1762
1757 if (timer_irq_works()) { 1763 if (timer_irq_works()) {
1758 apic_printk(APIC_VERBOSE," works.\n"); 1764 apic_printk(APIC_VERBOSE," works.\n");
1759 return; 1765 goto out;
1760 } 1766 }
1761 apic_printk(APIC_VERBOSE," failed :(.\n"); 1767 apic_printk(APIC_VERBOSE," failed :(.\n");
1762 panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n"); 1768 panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n");
1769out:
1770 local_irq_restore(flags);
1763} 1771}
1764 1772
1765static int __init notimercheck(char *s) 1773static int __init notimercheck(char *s)