Subject: [PATCH v4] ARM: sched_clock: allow sched_clock to be selected at runtime

From: [email-masked] (Marc Zyngier)
Date: Thu, 15 Dec 2011 11:04:20 +0000

On 15/12/11 01:56, Kukjin Kim wrote:
> Marc Zyngier wrote:
>>
>> sched_clock() is yet another blocker on the road to the single
>> image. This patch implements an idea by Russell King:
>>
>> http://www.spinics.net/lists/linux-omap/msg49561.html
>>
>> Instead of asking the platform to implement both sched_clock()
>> itself and the rollover callback, simply register a read()
>> function, and let the ARM code care about sched_clock() itself,
>> the conversion to ns and the rollover. sched_clock() uses
>> this read() function as an indirection to the platform code.
>> If the platform doesn't provide a read(), the code falls back
>> to the jiffy counter (just like the default sched_clock).
>>
>> This allow some simplifications and possibly some footprint gain
>> when multiple platforms are compiled in. Among the drawbacks,
>> the removal of the *_fixed_sched_clock optimization which could
>> negatively impact some platforms (sa1100, tegra, versatile
>> and omap).
>>
>> Tested on 11MPCore, OMAP4 and Tegra.
>>
>> Cc: Imre Kaloz <[email-masked]>
>> Cc: Krzysztof Halasa <[email-masked]>
>> Cc: Tony Lindgren <[email-masked]>
>> Cc: Eric Miao <[email-masked]>
>> Cc: Colin Cross <[email-masked]>
>> Cc: Erik Gilling <[email-masked]>
>> Cc: Olof Johansson <[email-masked]>
>> Cc: Linus Walleij <[email-masked]>
>> Cc: Sascha Hauer <[email-masked]>
>> Cc: Alessandro Rubini <[email-masked]>
>> Cc: STEricsson <[email-masked]>
>> Cc: Lennert Buytenhek <[email-masked]>
>> Cc: Nicolas Pitre <[email-masked]>
>> Cc: Ben Dooks <[email-masked]>
>> Cc: Kukjin Kim <[email-masked]>
> 
> Hi Marc,
> 
> There is a complaining with checkpatch.
> 
> ERROR: trailing whitespace
> #376: FILE: arch/arm/kernel/sched_clock.c:163:
> +^I^Isetup_sched_clock(jiffy_sched_clock_read, 32, HZ);^I$
> 
> And build warning:
> 
> arch/arm/plat-s5p/s5p-time.c: In function 's5p_read_sched_clock':
> arch/arm/plat-s5p/s5p-time.c:328: warning: 'return' with no value, in
> function returning non-void
> 
> I'm not sure what is proper return value in this case...

Good catch. The return value should be 0, and I'll update the patch now.

> Anyway, others, looks ok to me and tested on Samsung S5P boards.
> Acked-by: Kukjin Kim <[email-masked]>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...