linux/arch
Thomas Gleixner d36b49b910 [PATCH] i386 rework local apic timer calibration
The local apic timer calibration has two problem cases:

1.  The calibration is based on readout of the PIT/HPET timer to detect the
   wrap of the periodic tick.  It happens that a box gets stuck in the
   calibration loop due to a PIT with a broken readout function.

2.  CoreDuo boxen show a sporadic PIT runs too slow defect, which results
   in a wrong lapic calibration.  The PIT goes back to normal operation once
   the lapic timer is switched to periodic mode.

Both are existing and unfixed problems in the current upstream kernel and
prevent certain laptops and other systems from booting Linux.

Rework the code to address both problems:

- Make the calibration interrupt driven.  This removes the wait_timer_tick
  magic hackery from lapic.c and time_hpet.c.  The clockevents framework
  allows easy substitution of the global tick event handler for the
  calibration.  This is more accurate than monitoring jiffies.  At this point
  of the boot process, nothing disturbes the interrupt delivery, so the
  results are very accurate.

- Verify the calibration against the PM timer, when available by using the
  early access function.  When the measured calibration period is outside of
  an one percent window, then the lapic timer calibration is adjusted to the
  pm timer result.

- Verify the calibration by running the lapic timer with the calibration
  handler.  Disable lapic timer in case of deviation.

This also removes the "synchronization" of the local apic timer to the global
tick.  This synchronization never worked, as there is no way to synchronize
PIT(HPET) and local APIC timer.  The synchronization by waiting for the tick
just alignes the local APIC timer for the first events, but later the events
drift away due to the different clocks.  Removing the "sync" is just
randomizing the asynchronous behaviour at setup time.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Zachary Amsden <zach@vmware.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rohit Seth <rohitseth@google.com>
Cc: Andi Kleen <ak@suse.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-16 08:13:59 -08:00
..
alpha [PATCH] Dynamic kernel command-line: alpha 2007-02-12 09:48:37 -08:00
arm [PATCH] clocksource: fixup is_continous changes on ARM 2007-02-16 08:13:57 -08:00
arm26 [PATCH] Dynamic kernel command-line: arm26 2007-02-12 09:48:37 -08:00
avr32 [PATCH] clocksource: fixup is_continous changes on AVR32 2007-02-16 08:13:57 -08:00
cris [PATCH] mark struct file_operations const 2 2007-02-12 09:48:44 -08:00
frv [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
h8300 [PATCH] Dynamic kernel command-line: h8300 2007-02-12 09:48:38 -08:00
i386 [PATCH] i386 rework local apic timer calibration 2007-02-16 08:13:59 -08:00
ia64 ATA convert GSI to irq on ia64 2007-02-15 18:04:53 -05:00
m32r [PATCH] Dynamic kernel command-line: m32r 2007-02-12 09:48:38 -08:00
m68k [PATCH] Scheduled removal of SA_xxx interrupt flags fixups 2007-02-14 08:09:54 -08:00
m68knommu [PATCH] Dynamic kernel command-line: m68knommu 2007-02-12 09:48:38 -08:00
mips [PATCH] clocksource: fixup is_continous changes on MIPS 2007-02-16 08:13:57 -08:00
parisc [PATCH] mark struct file_operations const 2 2007-02-12 09:48:44 -08:00
powerpc [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
ppc [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
s390 [PATCH] clocksource: fixup is_continous changes on S390 2007-02-16 08:13:57 -08:00
sh sh: rts7751r2d board updates. 2007-02-15 18:20:52 +09:00
sh64 [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
sparc [SPARC]: Re-export saved_command_line to modules. 2007-02-12 15:15:48 -08:00
sparc64 [SPARC]: Re-export saved_command_line to modules. 2007-02-12 15:15:48 -08:00
um [PATCH] uml: fix 2.6.20 hang 2007-02-16 08:13:56 -08:00
v850 [PATCH] mark struct file_operations const 2 2007-02-12 09:48:44 -08:00
x86_64 [PATCH] x86: rewrite SMP TSC sync code 2007-02-16 08:13:57 -08:00
xtensa [PATCH] Dynamic kernel command-line: xtensa 2007-02-12 09:48:39 -08:00