Revision: 7318
http://sourceforge.net/p/astlinux/code/7318
Author: abelbeck
Date: 2015-11-06 17:48:11 +0000 (Fri, 06 Nov 2015)
Log Message:
-----------
linux, add kernel patch allowing Geode LX (alix and net5501) to use tsc clocksource instead of pit clocksource.
Ref: x86/platform: Fix Geode LX timekeeping in the generic x86 build
https://lkml.org/lkml/2015/9/16/432
https://dev.openwrt.org/ticket/20531
Added Paths:
-----------
branches/1.0/project/astlinux/kernel-patches/linux-920-fix-Geode-LX-timekeeping.patch
Added: branches/1.0/project/astlinux/kernel-patches/linux-920-fix-Geode-LX-timekeeping.patch
===================================================================
--- branches/1.0/project/astlinux/kernel-patches/linux-920-fix-Geode-LX-timekeeping.patch (rev 0)
+++ branches/1.0/project/astlinux/kernel-patches/linux-920-fix-Geode-LX-timekeeping.patch 2015-11-06 17:48:11 UTC (rev 7318)
@@ -0,0 +1,73 @@
+From 03da3ff1cfcd7774c8780d2547ba0d995f7dc03d Mon Sep 17 00:00:00 2001
+From: David Woodhouse <dw...@in...>
+Date: Wed, 16 Sep 2015 14:10:03 +0100
+Subject: x86/platform: Fix Geode LX timekeeping in the generic x86 build
+
+In 2007, commit 07190a08eef36 ("Mark TSC on GeodeLX reliable")
+bypassed verification of the TSC on Geode LX. However, this code
+(now in the check_system_tsc_reliable() function in
+arch/x86/kernel/tsc.c) was only present if CONFIG_MGEODE_LX was
+set.
+
+OpenWRT has recently started building its generic Geode target
+for Geode GX, not LX, to include support for additional
+platforms. This broke the timekeeping on LX-based devices,
+because the TSC wasn't marked as reliable:
+https://dev.openwrt.org/ticket/20531
+
+By adding a runtime check on is_geode_lx(), we can also include
+the fix if CONFIG_MGEODEGX1 or CONFIG_X86_GENERIC are set, thus
+fixing the problem.
+
+Signed-off-by: David Woodhouse <Dav...@in...>
+Cc: Andres Salomon <dil...@qu...>
+Cc: Linus Torvalds <tor...@li...>
+Cc: Marcelo Tosatti <ma...@kv...>
+Cc: Peter Zijlstra <pe...@in...>
+Cc: Thomas Gleixner <tg...@li...>
+Cc: st...@vg...
+Link: http://lkml.kernel.org/r/144...@in...
+Signed-off-by: Ingo Molnar <mi...@ke...>
+---
+ arch/x86/kernel/tsc.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
+index 79055cf..51e62d6 100644
+--- a/arch/x86/kernel/tsc.c
++++ b/arch/x86/kernel/tsc.c
+@@ -18,6 +18,7 @@
+ #include <asm/hypervisor.h>
+ #include <asm/nmi.h>
+ #include <asm/x86_init.h>
++#include <asm/geode.h>
+
+ unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
+ EXPORT_SYMBOL(cpu_khz);
+@@ -802,15 +803,17 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);
+
+ static void __init check_system_tsc_reliable(void)
+ {
+-#ifdef CONFIG_MGEODE_LX
+- /* RTSC counts during suspend */
++#if defined(CONFIG_MGEODEGX1) || defined(CONFIG_MGEODE_LX) || defined(CONFIG_X86_GENERIC)
++ if (is_geode_lx()) {
++ /* RTSC counts during suspend */
+ #define RTSC_SUSP 0x100
+- unsigned long res_low, res_high;
++ unsigned long res_low, res_high;
+
+- rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
+- /* Geode_LX - the OLPC CPU has a very reliable TSC */
+- if (res_low & RTSC_SUSP)
+- tsc_clocksource_reliable = 1;
++ rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
++ /* Geode_LX - the OLPC CPU has a very reliable TSC */
++ if (res_low & RTSC_SUSP)
++ tsc_clocksource_reliable = 1;
++ }
+ #endif
+ if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE))
+ tsc_clocksource_reliable = 1;
+--
+cgit v0.11.2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|