tools, update rtctest.c to verify passage of time
authorPrarit Bhargava <prarit@redhat.com>
Wed, 18 Mar 2015 19:46:33 +0000 (15:46 -0400)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 25 Mar 2015 04:02:59 +0000 (22:02 -0600)
commit0b63accf87225b5eb7e52814c374cf02d733d4bb
tree910f533f4eb0323ae0f9b0ee09109306c3eeeea9
parent4a5fd81507eaea556e533e9ebc8a3cf31fe159d1
tools, update rtctest.c to verify passage of time

rtctest.c checks to see if PIE is functioning by testing if 20 interrupts occur
at rates from 2HZ to 64HZ.  While this check is good, it does not check to
see if the correct amount of time has actually passed.  This misses
situations where the RTC may be operating at a higher or lower frequency
than expected.

This patch introduces a simple check to verify if the time passed is
less than 10% of what was programmed into the RTC.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Cc: corbet@lwn.net
Cc: rtc-linux@googlegroups.com
Cc: linux-doc@vger.kernel.org
Cc: a.zummo@towertech.it
Cc: prarit@redhat.com
Cc: john.stultz@linaro.org
Cc: shuahkh@osg.samsung.com
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/timers/rtctest.c