Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbdCHPHu (ORCPT ); Wed, 8 Mar 2017 10:07:50 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:47167 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751079AbdCHPH1 (ORCPT ); Wed, 8 Mar 2017 10:07:27 -0500 Date: Wed, 8 Mar 2017 16:06:23 +0100 (CET) From: Thomas Gleixner To: Alexandre Belloni cc: "Hadimani, Jagadish" , "Shah, Nehal-bakulchandra" , "a.zummo@towertech.it" , "rtc-linux@googlegroups.com" , "linux-kernel@vger.kernel.org" , Ingo Molnar Subject: Re: Kernel without RTC In-Reply-To: <20170308134748.yk52f7aqm7d4kwdg@piout.net> Message-ID: References: <221f9318-749f-03b8-aac8-85e9f9bec318@amd.com> <20170308131730.zrznsnk5oldfuoib@piout.net> <016032B5-A966-48A9-B60D-AD75B8B857EE@amd.com> <20170308134748.yk52f7aqm7d4kwdg@piout.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1342 Lines: 35 On Wed, 8 Mar 2017, Alexandre Belloni wrote: > On 08/03/2017 at 13:33:33 +0000, Hadimani, Jagadish wrote: > > Hello Alexandre, > > > > I guess the Linux kernel uses HPET timer... > > But can we can force Linux kernel to use Tsc or per core timer... > > > > That is probably the case but your are targeting the wrong subsystem. > The timekeeping is done using two different devices: clocksource and > clockevent. Usually, the drivers are in drivers/clocksource. I'm > definitively not an expert in x86 but the clockevent seems to be > registered from arch/x86/kernel/hpet.c and the clocksource from > arch/x86/kernel/tsc.c > > IIRC the clocksource is optional but the clockevent is mandatory so if > you don't have an HPET, you will need to register a clockevent device > from somewhere else. > > Maybe the simplest thing to do is to ask the x86 maintainers and the > time maintainers. Luckily for you, they are the same people (Thomas and > Ingo, added in cc). The scheduler uses TSC anyway. The RTC is only used for setting the wall clock time at boot and for figuring out the time a system spent in suspend. If you don't have an RTC then the boot wall clock time will be simply 1/1/1970 00:00:00. Jagadish, can you please explain what your problem is. Does the system fail to boot or does it behave strange or what? Thanks, tglx