]> git.baikalelectronics.ru Git - kernel.git/commit
clocksource: Make clocksource validation work for all clocksources
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 31 Oct 2015 10:20:55 +0000 (18:20 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Dec 2015 14:59:57 +0000 (15:59 +0100)
commit4dddaddd651e8c4d5706a53177225dd25c152485
treebc1df835ae7e7c64889961f3330cd7dc0e5448d7
parent604afd0310dd0b0db18278e1cf291cece2a9d525
clocksource: Make clocksource validation work for all clocksources

The clocksource validation which makes sure that the newly read value
is not smaller than the last value only works if the clocksource mask
is 64bit, i.e. the counter is 64bit wide. But we want to use that
mechanism also for clocksources which are less than 64bit wide.

So instead of checking whether bit 63 is set, we check whether the
most significant bit of the clocksource mask is set in the delta
result. If it is set, we return 0.

[ tglx: Simplified the implementation, added a comment and massaged
   the commit message ]

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Link: http://lkml.kernel.org/r/56349607.6070708@huawei.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/time/timekeeping_internal.h