From: john stultz Date: Thu, 5 May 2011 01:16:50 +0000 (-0700) Subject: clocksource: Install completely before selecting X-Git-Tag: v2.6.34.11~15 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=54d0eb4d980994c0743e9a9174ed2697da97f191;p=karo-tx-linux.git clocksource: Install completely before selecting commit e05b2efb82596905ebfe88e8612ee81dec9b6592 upstream. Christian Hoffmann reported that the command line clocksource override with acpi_pm timer fails: Kernel command line: clocksource=acpi_pm hpet clockevent registered Switching to clocksource hpet Override clocksource acpi_pm is not HRT compatible. Cannot switch while in HRT/NOHZ mode. The watchdog code is what enables CLOCK_SOURCE_VALID_FOR_HRES, but we actually end up selecting the clocksource before we enqueue it into the watchdog list, so that's why we see the warning and fail to switch to acpi_pm timer as requested. That's particularly bad when we want to debug timekeeping related problems in early boot. Put the selection call last. [PG: 34 doesn't have __clocksource_register_scale, so drop that 1/2] Reported-by: Christian Hoffmann Signed-off-by: John Stultz Link: http://lkml.kernel.org/r/%3C1304558210.2943.24.camel%40work-vm%3E Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 1f5dde637457..db24c5ce2cab 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -638,8 +638,8 @@ int clocksource_register(struct clocksource *cs) mutex_lock(&clocksource_mutex); clocksource_enqueue(cs); - clocksource_select(); clocksource_enqueue_watchdog(cs); + clocksource_select(); mutex_unlock(&clocksource_mutex); return 0; }