From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750893AbdAQOqE (ORCPT ); Tue, 17 Jan 2017 09:46:04 -0500 Received: from [195.159.176.226] ([195.159.176.226]:44625 "EHLO blaine.gmane.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751258AbdAQOov (ORCPT ); Tue, 17 Jan 2017 09:44:51 -0500 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Romain Izard Subject: Re: [PATCH] tcb_clksrc: Use 32 bit tcb as sched_clock Date: Tue, 17 Jan 2017 14:44:03 +0000 (UTC) Message-ID: References: <20170111135059.21318-1-david.engraf@sysgo.com> X-Complaints-To: usenet@blaine.gmane.org User-Agent: slrn/1.0.2 (Linux) Cc: linux-arm-kernel@lists.infradead.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-01-11, David Engraf wrote: > On newer boards the TC can be read as single 32 bit value without locking. > Thus the clock can be used as reference for sched_clock which is much more > accurate than the jiffies implementation. > > Tested on a Atmel SAMA5D2 board. > > Signed-off-by: David Engraf Unfortunately, this leads to the current boot warning: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at ../kernel/time/sched_clock.c:179 sched_clock_register+0x4c/0x21c Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.9.4-00041-ge780a8100f0d #1 Hardware name: Atmel SAMA5 [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0x24/0x28) [] (dump_stack) from [] (__warn+0xf4/0x10c) [] (__warn) from [] (warn_slowpath_null+0x30/0x38) [] (warn_slowpath_null) from [] (sched_clock_register+0x4c/0x21c) [] (sched_clock_register) from [] (tcb_clksrc_init+0x1c8/0x424) [] (tcb_clksrc_init) from [] (do_one_initcall+0x50/0x184) [] (do_one_initcall) from [] (kernel_init_freeable+0x13c/0x1e0) [] (kernel_init_freeable) from [] (kernel_init+0x18/0x124) [] (kernel_init) from [] (ret_from_fork+0x14/0x20) ---[ end trace 3d13186881cd5c91 ]--- "sched_clock_register" expects to be called with interrupts disabled, but the tcb_clksrc initialization is called as an arch_initcall, which runs too late in the boot sequence. Best regards, -- Romain Izard