aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/io_apic_64.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2008-05-27 16:19:51 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 03:13:07 -0400
commit691874fa96d6349a8b60f8ea9c2bae52ece79941 (patch)
treea705c041eb25329632eab0491244b4544218273b /arch/x86/kernel/io_apic_64.c
parent03be750559b2fe20d85dd968e08d5fe1c3accf83 (diff)
x86: I/O APIC: timer through 8259A second-chance
Some systems incorrectly report the ExtINTA pin of the I/O APIC as the genuine target of the timer interrupt. Here is a change that copies timer pin information found to the other pin if one has been found only. This way both a direct and a through-8259A route is tested with the pin letting these problematic systems work well enough. If no timer pin information has been found for the I/O APIC, then local APIC variations are tried only, similarly to what is done without the change (except without the misleading messages). Obviously if we try the first-chance path without being told by the BIOS to do so, we should not complain either, so do not print the message in this case. The 64-bit variation should be updated with a call to replace_pin_at_irq() which can be done with the upcoming merge. Since add_pin_to_irq() is now always called in the first-chance path, the condition to require it in the second-chance path no longer happens. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/io_apic_64.c')
-rw-r--r--arch/x86/kernel/io_apic_64.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
index ae0ac990574f..9a54b779abd4 100644
--- a/arch/x86/kernel/io_apic_64.c
+++ b/arch/x86/kernel/io_apic_64.c
@@ -1638,6 +1638,7 @@ static inline void __init check_timer(void)
1638 struct irq_cfg *cfg = irq_cfg + 0; 1638 struct irq_cfg *cfg = irq_cfg + 0;
1639 int apic1, pin1, apic2, pin2; 1639 int apic1, pin1, apic2, pin2;
1640 unsigned long flags; 1640 unsigned long flags;
1641 int no_pin1 = 0;
1641 1642
1642 local_irq_save(flags); 1643 local_irq_save(flags);
1643 1644
@@ -1662,10 +1663,30 @@ static inline void __init check_timer(void)
1662 apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", 1663 apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
1663 cfg->vector, apic1, pin1, apic2, pin2); 1664 cfg->vector, apic1, pin1, apic2, pin2);
1664 1665
1666 /*
1667 * Some BIOS writers are clueless and report the ExtINTA
1668 * I/O APIC input from the cascaded 8259A as the timer
1669 * interrupt input. So just in case, if only one pin
1670 * was found above, try it both directly and through the
1671 * 8259A.
1672 */
1673 if (pin1 == -1) {
1674 pin1 = pin2;
1675 apic1 = apic2;
1676 no_pin1 = 1;
1677 } else if (pin2 == -1) {
1678 pin2 = pin1;
1679 apic2 = apic1;
1680 }
1681
1665 if (pin1 != -1) { 1682 if (pin1 != -1) {
1666 /* 1683 /*
1667 * Ok, does IRQ0 through the IOAPIC work? 1684 * Ok, does IRQ0 through the IOAPIC work?
1668 */ 1685 */
1686 if (no_pin1) {
1687 add_pin_to_irq(0, apic1, pin1);
1688 setup_timer_IRQ0_pin(apic1, pin1, vector);
1689 }
1669 unmask_IO_APIC_irq(0); 1690 unmask_IO_APIC_irq(0);
1670 if (!no_timer_check && timer_irq_works()) { 1691 if (!no_timer_check && timer_irq_works()) {
1671 nmi_watchdog_default(); 1692 nmi_watchdog_default();
@@ -1678,18 +1699,19 @@ static inline void __init check_timer(void)
1678 goto out; 1699 goto out;
1679 } 1700 }
1680 clear_IO_APIC_pin(apic1, pin1); 1701 clear_IO_APIC_pin(apic1, pin1);
1681 apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not " 1702 if (!no_pin1)
1682 "connected to IO-APIC\n"); 1703 apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: "
1683 } 1704 "8254 timer not connected to IO-APIC\n");
1684 1705
1685 apic_printk(APIC_VERBOSE,KERN_INFO "...trying to set up timer (IRQ0) " 1706 apic_printk(APIC_VERBOSE,KERN_INFO
1686 "through the 8259A ... "); 1707 "...trying to set up timer (IRQ0) "
1687 if (pin2 != -1) { 1708 "through the 8259A ... ");
1688 apic_printk(APIC_VERBOSE,"\n..... (found apic %d pin %d) ...", 1709 apic_printk(APIC_VERBOSE,"\n..... (found apic %d pin %d) ...",
1689 apic2, pin2); 1710 apic2, pin2);
1690 /* 1711 /*
1691 * legacy devices should be connected to IO APIC #0 1712 * legacy devices should be connected to IO APIC #0
1692 */ 1713 */
1714 /* replace_pin_at_irq(0, apic1, pin1, apic2, pin2); */
1693 setup_timer_IRQ0_pin(apic2, pin2, cfg->vector); 1715 setup_timer_IRQ0_pin(apic2, pin2, cfg->vector);
1694 unmask_IO_APIC_irq(0); 1716 unmask_IO_APIC_irq(0);
1695 enable_8259A_irq(0); 1717 enable_8259A_irq(0);
@@ -1709,8 +1731,8 @@ static inline void __init check_timer(void)
1709 */ 1731 */
1710 disable_8259A_irq(0); 1732 disable_8259A_irq(0);
1711 clear_IO_APIC_pin(apic2, pin2); 1733 clear_IO_APIC_pin(apic2, pin2);
1734 apic_printk(APIC_VERBOSE," failed.\n");
1712 } 1735 }
1713 apic_printk(APIC_VERBOSE," failed.\n");
1714 1736
1715 if (nmi_watchdog == NMI_IO_APIC) { 1737 if (nmi_watchdog == NMI_IO_APIC) {
1716 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); 1738 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n");