android_kernel_xiaomi_sm8350/include/asm-i386
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
..
mach-bigsmp
mach-default [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
mach-es7000 ACPICA: Remove duplicate table definitions (non-conflicting), cont 2007-02-02 21:14:29 -05:00
mach-generic
mach-numaq
mach-summit
mach-visws
mach-voyager [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
8253pit.h
a.out.h
acpi.h ACPICA: Allow ACPI id to be u32 instead of u8. 2007-02-02 21:14:31 -05:00
agp.h
alternative-asm.i
alternative.h
apic.h [PATCH] i386 rework local apic timer calibration 2007-02-16 08:13:59 -08:00
apicdef.h
arch_hooks.h
atomic.h [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
auxvec.h
bitops.h [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
boot.h [PATCH] i386: Restore CONFIG_PHYSICAL_START option 2007-01-05 23:55:23 -08:00
bug.h [PATCH] Generic BUG for i386 2006-12-08 08:28:39 -08:00
bugs.h [PATCH] i386: improve sched_clock() on i686 2007-02-13 13:26:22 +01:00
byteorder.h
cache.h
cacheflush.h [PATCH] Optimize D-cache alias handling on fork 2006-12-13 09:27:08 -08:00
checksum.h
cpu.h
cpufeature.h
cputime.h
current.h
debugreg.h
delay.h
desc.h [PATCH] i386: Rename cpu_gdt_descr and remove extern declaration from smpboot.c 2007-02-13 13:26:26 +01:00
device.h
div64.h
dma-mapping.h [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
dma.h
dmi.h
dwarf2.h
e820.h [PATCH] compile error of register_memory() 2006-12-22 08:55:49 -08:00
edac.h
elf.h [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
emergency-restart.h
errno.h
fcntl.h
fixmap.h [PATCH] Fix CONFIG_COMPAT_VDSO 2007-01-26 13:50:58 -08:00
floppy.h
frame.i
futex.h
genapic.h
hardirq.h
highmem.h
hpet.h [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
hw_irq.h
hypertransport.h
i387.h
i8253.h [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
i8259.h
ide.h [PATCH] ide: more conversion to pci_get APIs 2006-12-08 08:29:03 -08:00
idle.h [PATCH] i386: add idle notifier 2007-02-13 13:26:22 +01:00
intel_arch_perfmon.h
io_apic.h
io.h [PATCH] kill eth_io_copy_and_sum() 2007-02-09 09:14:07 -08:00
ioctl.h
ioctls.h
ipc.h
ipcbuf.h
irq_regs.h
irq.h
irqflags.h
ist.h
k8.h
Kbuild [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
kdebug.h
kexec.h
kmap_types.h
kprobes.h
ldt.h
linkage.h
local.h
math_emu.h
mc146818rtc.h
mca_dma.h
mca.h
mce.h [PATCH] i386: Move mce_disabled to asm/mce.h 2007-02-13 13:26:26 +01:00
mman.h
mmu_context.h [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
mmu.h
mmx.h
mmzone.h
module.h
mpspec_def.h
mpspec.h [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
msgbuf.h
msidef.h
msr.h [PATCH] Mark TSC on GeodeLX reliable 2007-02-16 08:13:58 -08:00
mtrr.h
mutex.h
namei.h
nmi.h
numa.h
numaq.h
page.h [PATCH] Fix CONFIG_COMPAT_VDSO 2007-01-26 13:50:58 -08:00
param.h [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
paravirt.h [PATCH] i386: Remove fastcall in paravirt.[ch] 2007-02-13 13:26:25 +01:00
parport.h
pci-direct.h
pci.h
pda.h [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
percpu.h
pgalloc.h [PATCH] MM: page allocation hooks for VMI backend 2007-02-13 13:26:21 +01:00
pgtable-2level-defs.h
pgtable-2level.h
pgtable-3level-defs.h
pgtable-3level.h
pgtable.h Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
poll.h
posix_types.h
processor.h [PATCH] i386: add idle notifier 2007-02-13 13:26:22 +01:00
ptrace-abi.h
ptrace.h [PATCH] i386: Profile pc badness 2007-02-13 13:26:21 +01:00
resource.h
rtc.h
rwlock.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
segment.h [PATCH] i386: Profile pc badness 2007-02-13 13:26:21 +01:00
semaphore.h
sembuf.h
serial.h
setup.h [PATCH] i386: Remove extern declaration from mm/discontig.c, put in header. 2007-02-13 13:26:26 +01:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h [PATCH] i386: SMP boot hook for paravirt 2007-02-13 13:26:21 +01:00
socket.h
sockios.h
sparsemem.h
spinlock_types.h
spinlock.h
srat.h
stacktrace.h
stat.h
statfs.h
string.h
suspend.h Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
sync_bitops.h
system.h
termbits.h [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
termios.h [PATCH] consolidate line discipline number definitions 2007-02-11 10:51:26 -08:00
therm_throt.h
thread_info.h [PATCH] PM: Fix SMP races in the freezer 2006-12-13 09:05:49 -08:00
time.h [PATCH] i386: vMI timer patches 2007-02-13 13:26:21 +01:00
timer.h [PATCH] i386: vMI timer patches 2007-02-13 13:26:21 +01:00
timex.h
tlb.h
tlbflush.h
topology.h [PATCH] sched: add option to serialize load balancing 2006-12-10 09:55:43 -08:00
tsc.h [PATCH] x86: rewrite SMP TSC sync code 2007-02-16 08:13:57 -08:00
types.h
uaccess.h [PATCH] fix sparse warnings from {asm,net}/checksum.h 2007-02-11 10:51:31 -08:00
ucontext.h
unaligned.h
unistd.h [PATCH] remove kernel syscalls 2006-12-07 08:39:37 -08:00
unwind.h Remove stack unwinder for now 2006-12-15 08:47:51 -08:00
user.h
vga.h
vic.h
vm86.h
vmi_time.h [PATCH] i386: vMI timer patches 2007-02-13 13:26:21 +01:00
vmi.h [PATCH] i386: vMI backend for paravirt-ops 2007-02-13 13:26:21 +01:00
voyager.h
xor.h