android_kernel_xiaomi_sm8350/arch/i386/kernel
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
..
acpi [PATCH] Allow early access to the power management timer 2007-02-16 08:13:58 -08:00
cpu [PATCH] i386: fix 32-bit ioctls on x64_32 2007-02-13 13:26:26 +01:00
.gitignore
alternative.c
apic.c [PATCH] i386 rework local apic timer calibration 2007-02-16 08:13:59 -08:00
apm.c [PATCH] i386: use GTOD persistent clock support 2007-02-16 08:13:57 -08:00
asm-offsets.c [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
bootflag.c
cpuid.c [PATCH] i386: use smp_call_function_single() 2007-02-13 13:26:23 +01:00
crash_dump.c
crash.c
doublefault.c
e820.c [PATCH] i386: romsignature/checksum cleanup 2007-02-13 13:26:22 +01:00
early_printk.c
efi_stub.S
efi.c [PATCH] EFI x86: pass firmware call parameters on the stack 2007-02-04 10:27:10 -08:00
entry.S [PATCH] i386: entry.S END/ENDPROC annotations 2007-02-13 13:26:24 +01:00
head.S [PATCH] i386: Rename cpu_gdt_descr and remove extern declaration from smpboot.c 2007-02-13 13:26:26 +01:00
hpet.c [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
i386_ksyms.c
i387.c
i8237.c
i8253.c [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
i8259.c [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
init_task.c
io_apic.c [PATCH] i386, apic: clean up the APIC code 2007-02-16 08:13:58 -08:00
ioport.c
irq.c [PATCH] i386, apic: clean up the APIC code 2007-02-16 08:13:58 -08:00
kprobes.c [PATCH] i386: Kprobe rpl fix 2007-02-13 13:26:21 +01:00
ldt.c
machine_kexec.c
Makefile [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
mca.c
microcode.c [PATCH] i386: Fix warning in microcode.c 2007-02-13 13:26:25 +01:00
module.c
mpparse.c ACPICA: use new ACPI headers. 2007-02-02 21:14:28 -05:00
msr.c [PATCH] i386: use smp_call_function_single() 2007-02-13 13:26:23 +01:00
nmi.c [PATCH] x86: Enable NMI watchdog for AMD Family 0x10 CPUs 2007-02-13 13:26:25 +01:00
numaq.c
paravirt.c [PATCH] i386: paravirt unhandled fallthrough 2007-02-13 13:26:26 +01:00
pci-dma.c
pcspeaker.c [PATCH] x86: Unify pcspeaker platform device code between i386/x86-64 2007-02-13 13:26:26 +01:00
process.c [PATCH] i386: add idle notifier 2007-02-13 13:26:22 +01:00
ptrace.c [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
quirks.c
reboot_fixups.c
reboot.c
relocate_kernel.S
scx200.c
setup.c [PATCH] x86: Unify pcspeaker platform device code between i386/x86-64 2007-02-13 13:26:26 +01:00
sigframe.h
signal.c [PATCH] x86: Don't require the vDSO for handling a.out signals 2007-02-13 13:26:26 +01:00
smp.c [PATCH] i386: Small cleanup to TLB flush code 2007-02-13 13:26:23 +01:00
smpboot.c [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
srat.c ACPI: build fix for IBM x440 - CONFIG_X86_SUMMIT 2007-02-02 21:47:33 -05:00
summit.c
sys_i386.c
syscall_table.S
sysenter.c [PATCH] i386: Fix broken CONFIG_COMPAT_VDSO on i386 2007-02-13 13:26:26 +01:00
time.c [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
topology.c
trampoline.S [PATCH] i386: fix modpost warning in SMP trampoline code 2007-01-05 23:55:23 -08:00
traps.c [PATCH] i386: add option to show more code in oops reports 2007-02-13 13:26:25 +01:00
tsc_sync.c [PATCH] x86: rewrite SMP TSC sync code 2007-02-16 08:13:57 -08:00
tsc.c [PATCH] Mark TSC on GeodeLX reliable 2007-02-16 08:13:58 -08:00
vm86.c [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
vmi.c [PATCH] i386: vMI timer patches 2007-02-13 13:26:21 +01:00
vmitime.c [PATCH] clocksource: replace is_continuous by a flag field 2007-02-16 08:13:57 -08:00
vmlinux.lds.S [PATCH] i386: move startup_32() in text.head section 2007-02-13 13:26:22 +01:00
vsyscall-int80.S
vsyscall-note.S
vsyscall-sigreturn.S
vsyscall-sysenter.S
vsyscall.lds.S
vsyscall.S