aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/timers (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-05-08Merge tag 'linux-kselftest-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftestLinus Torvalds1-1/+1
Pull kselftest updates from Shuah Khan: "This update consists of: - important fixes for build failures and clean target related warnings to address regressions introduced in commit 88baa78d1f31 ("selftests: remove duplicated all and clean target") - several minor spelling fixes in and log messages and comment blocks. - Enabling configs for better test coverage in ftrace, vm, and cpufreq tests. - .gitignore changes" * tag 'linux-kselftest-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (26 commits) selftests: x86: add missing executables to .gitignore selftests: watchdog: accept multiple params on command line selftests: create cpufreq kconfig fragments selftests: x86: override clean in lib.mk to fix warnings selftests: sync: override clean in lib.mk to fix warnings selftests: splice: override clean in lib.mk to fix warnings selftests: gpio: fix clean target to remove all generated files and dirs selftests: add gpio generated files to .gitignore selftests: powerpc: override clean in lib.mk to fix warnings selftests: gpio: override clean in lib.mk to fix warnings selftests: futex: override clean in lib.mk to fix warnings selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean selftests: splice: fix clean target to not remove default_file_splice_read.sh selftests: gpio: add config fragment for gpio-mockup selftests: breakpoints: allow to cross-compile for aarch64/arm64 selftests/Makefile: Add missed PHONY targets selftests/vm/run_vmtests: Fix wrong comment selftests/Makefile: Add missed closing `"` in comment selftests/vm/run_vmtests: Polish output text selftests/timers: fix spelling mistake: "Asynchronous" ...
2017-04-13selftests/timers: fix spelling mistake: "Asynchronous"Colin Ian King1-1/+1
trivial fix to spelling mistake in printed message. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-03-24selftests/timers: Spelling s/privledges/privileges/Geert Uytterhoeven1-2/+2
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-01-05selftests: remove CROSS_COMPILE in dedicated Makefilebamvor.zhangjian@huawei.com1-1/+0
After previous clean up patches, memfd and timers could get CROSS_COMPILE from tools/testing/selftest/lib.mk. There is no need to preserve these definition. So, this patch remove them. Acked-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-01-05selftests: remove duplicated all and clean targetbamvor.zhangjian@huawei.com1-7/+2
Currently, kselftest use TEST_PROGS, TEST_PROGS_EXTENDED, TEST_FILES to indicate the test program, extended test program and test files. It is easy to understand the purpose of these files. But mix of compiled and uncompiled files lead to duplicated "all" and "clean" targets. In order to remove the duplicated targets, introduce TEST_GEN_PROGS, TEST_GEN_PROGS_EXTENDED, TEST_GEN_FILES to indicate the compiled objects. Also, the later patch will make use of TEST_GEN_XXX to redirect these files to output directory indicated by KBUILD_OUTPUT or O. And add this changes to "Contributing new tests(details)" of Documentation/kselftest.txt. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-15Merge tag 'linux-kselftest-4.10-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftestLinus Torvalds1-0/+1
Pull kselftest updates from Shuah Khan: "This update consists of: - new tests to exercise the Sync Kernel Infrastructure. These tests are part of a battery of Android libsync tests and are re-written to test the new sync user-space interfaces from Emilio López, and Gustavo Padovan. - test to run hw-independent mock tests for i915.ko from Chris Wilson - a new gpio test case from Bamvor Jian Zhang - missing gitignore additions" * tag 'linux-kselftest-4.10-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftest/gpio: add gpio test case selftest: sync: improve assert() failure message kselftests: Exercise hw-independent mock tests for i915.ko selftests: add missing gitignore files/dirs selftests: add missing set-tz to timers .gitignore selftest: sync: stress test for merges selftest: sync: stress consumer/producer test selftest: sync: stress test for parallelism selftest: sync: wait tests for sw_sync framework selftest: sync: merge tests for sw_sync framework selftest: sync: fence tests for sw_sync framework selftest: sync: basic tests for sw_sync framework
2016-12-08selftests: add missing set-tz to timers .gitignoreShuah Khan1-0/+1
set-tz is missing from timers/.gitignore. Add it. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-11-29selftests/timers: Fix spelling mistake "Asyncrhonous" -> "Asynchronous"Colin Ian King1-1/+1
Trivial fix to spelling mistake Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Link: http://lkml.kernel.org/r/1480372524-15181-2-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2016-09-20selftests/timers: Add missing error code assignment before testChristophe JAILLET1-2/+2
In order to work, the 'err' return value has to be updated otherwise the test can never be true. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-08-05Merge tag 'rtc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linuxLinus Torvalds1-3/+10
Pull RTC updates from Alexandre Belloni: "RTC for 4.8 Cleanups: - huge cleanup of rtc-generic and char/genrtc this allowed to cleanup rtc-cmos, rtc-sh, rtc-m68k, rtc-powerpc and rtc-parisc - move mn10300 to rtc-cmos Subsystem: - fix wakealarms after hibernate - multiples fixes for rctest - simplify implementations of .read_alarm New drivers: - Maxim MAX6916 Drivers: - ds1307: fix weekday - m41t80: add wakeup support - pcf85063: add support for PCF85063A variant - rv8803: extend i2c fix and other fixes - s35390a: fix alarm reading, this fixes instant reboot after shutdown for QNAP TS-41x - s3c: clock fixes" * tag 'rtc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (65 commits) rtc: rv8803: Clear V1F when setting the time rtc: rv8803: Stop the clock while setting the time rtc: rv8803: Always apply the I²C workaround rtc: rv8803: Fix read day of week rtc: rv8803: Remove the check for valid time rtc: rv8803: Kconfig: Indicate rx8900 support rtc: asm9260: remove .owner field for driver rtc: at91sam9: Fix missing spin_lock_init() rtc: m41t80: add suspend handlers for alarm IRQ rtc: m41t80: make it a real error message rtc: pcf85063: Add support for the PCF85063A device rtc: pcf85063: fix year range rtc: hym8563: in .read_alarm set .tm_sec to 0 to signal minute accuracy rtc: explicitly set tm_sec = 0 for drivers with minute accurancy rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq() rtc: s3c: Remove unnecessary call to disable already disabled clock rtc: abx80x: use devm_add_action_or_reset() rtc: m41t80: use devm_add_action_or_reset() rtc: fix a typo and reduce three empty lines to one rtc: s35390a: improve two comments in .set_alarm ...
2016-06-26rtc: rtctest: Change no IRQ detection for RTC_IRQP_SETAndrey Smirnov1-1/+1
A call to ioctl(..., RTC_IRQP_SET, ...) should never result in ENOTTY. All new style RTC drivers implement it and all of the old style drivers return EINVAL when they don't support periodic IRQs. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-06-26rtc: rtctest: Change no IRQ detection for RTC_IRQP_READAndrey Smirnov1-1/+1
A call to ioctl(..., RTC_IRQP_READ, ...) should never result in ENOTTY. All new style RTC drivers implement it and all of the old style drivers return EINVAL when they don't support periodic IRQs. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-06-26rtc: rtctest: Change alarm IRQ support detectionAndrey Smirnov1-1/+8
For old style drivers, call a call to ioctl(..., RTC_ALM_SET, ...): - char/ds1302.c will always return -EINVAL - char/genrtc.c: will always return -EINVAL - char/rtc.c will succeed regardless if IRQs are supported or not - char/efirtc.c will always return -EINVAL - input/misc/hp_sdc_rtc.c ... that ioctl code is a good lesson about ifdefing code out and punting implementation ... and it will always return -EINVAL For new style rtc drivers, a call to ioctl(..., RTC_ALM_SET, ...) never results in a call to __rtc_set_alarm, since struct rtc_wkalarm passed to rtc_set_alarm has 'enabled' field set to 0. This means that rtc->ops->set_alarm driver hook is never called in that ioctl. Since no driver code interaction happens as a part of that call, using its results to ascertain properties of the driver is not going to work. To remedy this - use the result of RTC_AIE_ON to make the judgement. This patch also changes ENOTTY to EINVAL as an error code value that would tell us that IRQs are not supported. There are three reason for this: - As mentioned above old style driver never returns ENOTTY for this ioctl - In it's code __rtc_set_alarm() returns -EINVAL if rtc->ops->set_alarm method is not provided by the driver, so one reason for change is to be consistent with that code path. - A call to ioctl(..., RTC_UIE_ON, ...) will result in a call to rtc_update_irq_enable() and then __rtc_set_alarm(), which, if IRQs are not supported by the driver, will result in a non-zero error code. Returning ENOTTY in that case would: a) Not be consistent with other codepaths of rtc_update_irq_enable, for example the check of rtc->uie_unsupported b) Would break update IRQ emulation code since that codpath expects EINVAL c) Would break test's logic for feature support detection in the case of RTC_UIE_ON ioctl Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-06-02kselftests: timers: Add set-tz test caseJohn Stultz2-1/+121
Mika Westerberg reported a erroneous change in the error checking of settimeofday, so I wanted to add a test to ensure we don't trip over this again. Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Baolin Wang <baolin.wang@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Prarit Bhargava <prarit@redhat.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-03-17Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-1/+1
Pull trivial tree updates from Jiri Kosina. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: drivers/rtc: broken link fix drm/i915 Fix typos in i915_gem_fence.c Docs: fix missing word in REPORTING-BUGS lib+mm: fix few spelling mistakes MAINTAINERS: add git URL for APM driver treewide: Fix typo in printk
2016-02-15treewide: Fix typo in printkMasanari Iida1-1/+1
This patch fix spelling typos found in printk and Kconfig. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-01-31Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tipLinus Torvalds1-1/+138
Pull timer fixes from Thomas Gleixner: "The timer departement delivers: - a regression fix for the NTP code along with a proper selftest - prevent a spurious timer interrupt in the NOHZ lowres code - a fix for user space interfaces returning the remaining time on architectures with CONFIG_TIME_LOW_RES=y - a few patches to fix COMPILE_TEST fallout" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tick/nohz: Set the correct expiry when switching to nohz/lowres mode clocksource: Fix dependencies for archs w/o HAS_IOMEM clocksource: Select CLKSRC_MMIO where needed tick/sched: Hide unused oneshot timer code kselftests: timers: Add adjtimex SETOFFSET validity tests ntp: Fix ADJ_SETOFFSET being used w/ ADJ_NANO itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper hrtimer: Handle remaining time proper for TIME_LOW_RES clockevents/tcb_clksrc: Prevent disabling an already disabled clock
2016-01-26kselftests: timers: Add adjtimex SETOFFSET validity testsJohn Stultz1-1/+138
Add some simple tests to check both valid and invalid offsets when using adjtimex's ADJ_SETOFFSET method. Signed-off-by: John Stultz <john.stultz@linaro.org> Acked-by: Shuah Khan <shuahkh@osg.samsung.com> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Harald Hoyer <harald@redhat.com> Cc: Kay Sievers <kay@vrfy.org> Cc: David Herrmann <dh.herrmann@gmail.com> Link: http://lkml.kernel.org/r/1453417415-19110-3-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2016-01-17Merge tag 'linux-kselftest-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftestLinus Torvalds1-0/+1
Pull kselftest updates from Shuah Khan: "This 14 patch update: - adds a new test for intel_pstate driver - adds empty string and async test cases to firmware class tests - fixes and cleans up several existing tests" * tag 'linux-kselftest-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: firmware: add empty string and async tests firmware: actually return NULL on failed request_firmware_nowait() test: firmware_class: add asynchronous request trigger test: firmware_class: use kstrndup() where appropriate test: firmware_class: report errors properly on failure selftests/seccomp: fix 32-bit build warnings add breakpoints/.gitignore add ptrace/.gitignore update .gitignore in selftests/timers update .gitignore in selftests/vm tools, testing, add test for intel_pstate driver selftest/ipc: actually test it selftests/capabilities: actually test it selftests/capabilities: clean up for Makefile
2016-01-07update .gitignore in selftests/timersYuan Sun1-0/+1
Signed-off-by: Yuan Sun <sunyuan3@huawei.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-12-10selftests/timers: fix write return value handlngAndrzej Hajda1-1/+1
The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2015-11-10Merge tag 'linux-kselftest-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftestLinus Torvalds1-0/+1
Pull kselftest updates from Shuah Khan: "This 12 patch update for 4.4-rc1 consists of a new pstore test and fixes to existing tests" * tag 'linux-kselftest-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: breakpoint: Actually build it selftests: vm: Try harder to allocate huge pages selftests: Make scripts executable selftests: kprobe: Choose an always-defined function to probe selftests: memfd: Stop unnecessary rebuilds selftests: Add missing #include directives selftests/seccomp: Be more precise with syscall arguments. selftests/seccomp: build and pass on arm64 selftests: memfd_test: Revised STACK_SIZE to make it 16-byte aligned selftests/pstore: add pstore test scripts going with reboot selftests/pstore: add pstore test script for pre-reboot selftests: add .gitignore for efivarfs
2015-11-10Merge tag 'rtc-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linuxLinus Torvalds1-1/+1
Pull RTC updates from Alexandre Belloni: "Core: - Fix rtctest error path New drivers: - Microcrystal RV8803 Subsystem wide cleanups: - remove misuse of IRQF_NO_SUSPEND flag Drivers: - at91rm9200: clear RTC alarm status flag prior to suspending - davinci: remove incorrect reference to probe function - ds1307: Fix alarm programming for mcp794xx - ds1390: trickle charger support, fix ds1390_get_reg - isl1208: Pass the IRQF_ONESHOT flag - opal: fix type of token - pcf2127: fix RTC_READ_VL, remove useless driver version - pcf85063: return an error when date is invalid - pcf8563: add CLKOUT to common clock framework - rx8025: remove unnecessary braces - s3c: Set year, month, day value for setting alarm - stmp3xxx: unify register access macros - License fixes: pcf2127, da9063 - wakeup-source support for isl12057 and opal" * tag 'rtc-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (23 commits) rtc: Add a driver for Micro Crystal RV8803 rtc: s3c: Set year, month, day value for setting alarm rtc: ds1307: Fix alarm programming for mcp794xx rtc: isl12057: enable support for the standard "wakeup-source" property rtc: opal: enable support for the stardard "wakeup-source" property rtc: isl1208: Pass the IRQF_ONESHOT flag rtc: pcf8563: add CLKOUT to common clock framework rtc: davinci: remove incorrect reference to probe function rtc: at91rm9200: clear RTC alarm status flag prior to suspending rtc: pcf2127: remove useless driver version rtc: pcf2127: fix reading uninitialized value on RTC_READ_VL ioctl rtc: stmp3xxx: unify register access macros rtc: da9063: GPL copyright inconsistency fix rtc: pcf85063: return an error when date is invalid rtc: rx8025: remove unnecessary braces rtc: ds1343: remove misuse of IRQF_NO_SUSPEND flag rtc: ab8500: remove misuse of IRQF_NO_SUSPEND flag rtc: pl031: remove misuse of IRQF_NO_SUSPEND flag rtc: opal: fix type of token rtc: ds1390: Add trickle charger device tree binding ...
2015-11-03selftests: Add missing #include directivesBen Hutchings1-0/+1
Several C programs fail to include the headers declaring all the functions they call, resulting in warnings or errors. After this, memfd_test.c is still missing some function declarations but can't easily get them because of a conflict between <linux/fcntl.h> and <sys/fcntl.h>. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-11-03rtc: rtctest: enabling UIE for a chip that doesn't support it returns EINVALUwe Kleine-König1-1/+1
Calling ioctl(..., RTC_UIE_ON, ...) without CONFIG_RTC_INTF_DEV_UIE_EMUL either ends in rtc_update_irq_enable if rtc->uie_unsupported is true or in __rtc_set_alarm in the if (!rtc->ops->set_alarm) branch. In both cases the return value is -EINVAL. So check for that one instead of ENOTTY. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2015-10-12timers, kselftest: Add 'adjtick' test to validate adjtimex() tick adjustmentsJohn Stultz2-1/+223
Recently a kernel side NTP bug was fixed via the following commit: 2619d7e9c92d ("time: Fix timekeeping_freqadjust()'s incorrect use of abs() instead of abs64()") When the bug was reported it was difficult to detect, except by tweaking the adjtimex tick value, and noticing how quickly the adjustment took: https://lkml.org/lkml/2015/9/1/488 Thus this patch introduces a new test which manipulates the adjtimex tick value and validates that the results are what we expect. Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Miroslav Lichvar <mlichvar@redhat.com> Cc: Nuno Gonçalves <nunojpg@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1444094217-20258-1-git-send-email-john.stultz@linaro.org [ Tidied up the code and the changelog a bit. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-06-29Merge tag 'linux-kselftest-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftestLinus Torvalds2-3/+25
Pull kselftest update from Shuah Khan: "This update adds two new test suites: futex and seccomp. In addition, it includes fixes for bugs in timers, other tests, and compile framework. It introduces new quicktest feature to enable users to choose to run tests that complete in a short time" * tag 'linux-kselftest-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: add quicktest support selftests: add seccomp suite selftest, x86: fix incorrect comment tools selftests: Fix 'clean' target with make 3.81 selftests/futex: Add .gitignore kselftest: Add exit code defines selftests: Add futex tests to the top-level Makefile selftests/futex: Increment ksft pass and fail counters selftests/futex: Update Makefile to use lib.mk selftests: Add futex functional tests kselftests: timers: Check _ALARM clockids are supported before suspending kselftests: timers: Ease alarmtimer-suspend unreasonable latency value kselftests: timers: Increase delay between suspends in alarmtimer-suspend selftests/exec: do not install subdir as it is already created selftests/ftrace: install test.d selftests: copy TEST_DIRS to INSTALL_PATH Test compaction of mlocked memory selftests/mount: output WARN messages when mount test skipped selftests/timers: Make git ignore all binaries in timers test suite
2015-06-18selftest: Timers: Avoid signal deadlock in leap-a-dayJohn Stultz1-11/+12
In 0c4a5fc95b1df (Add leap-second timer edge testing to leap-a-day.c), we added a timer to the test which checks to make sure timers near the leapsecond edge behave correctly. However, the output generated from the timer uses ctime_r, which isn't async-signal safe, and should that signal land while the main test is using ctime_r to print its output, its possible for the test to deadlock on glibc internal locks. Thus this patch reworks the output to avoid using ctime_r in the signal handler. Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Daniel Bristot de Oliveira <bristot@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Jan Kara <jack@suse.cz> Cc: Jiri Bohac <jbohac@suse.cz> Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1434565003-3386-1-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-06-12selftests: timers: Add leap-second timer edge testing to leap-a-day.cJohn Stultz1-4/+72
Prarit reported an issue w/ timers around the leapsecond, where a timer set for Midnight UTC (00:00:00) might fire a second early right before the leapsecond (23:59:60 - though it appears as a repeated 23:59:59) is applied. So I've updated the leap-a-day.c test to integrate a similar test, where we set a timer and check if it triggers at the right time, and if the ntp state transition is managed properly. Reported-by: Daniel Bristot de Oliveira <bristot@redhat.com> Reported-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Jan Kara <jack@suse.cz> Cc: Jiri Bohac <jbohac@suse.cz> Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1434063297-28657-6-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-05-26kselftests: timers: Check _ALARM clockids are supported before suspendingJohn Stultz1-1/+5
It was reported that the alarmtimer-suspend test hangs on older systems that don't support _ALARM clockids. This is due to the fact that we don't check if the timer_create fails, and thus when we suspend, the system will not programatically resume. Fix this by checking the timer_create call for errors. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-05-26kselftests: timers: Ease alarmtimer-suspend unreasonable latency valueJohn Stultz1-1/+1
On the hardware I have, resume latency from an alarm is often 2-3 seconds (with a fair amount of variability due to the RTC's single second granularity). Having four seconds be the pass/fail bar is maybe a little too tight, so extend this to 5 seconds. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-05-26kselftests: timers: Increase delay between suspends in alarmtimer-suspendJohn Stultz1-1/+1
When testing on some hardware, waiting only a second before re-triggering suspend can keep TCP connections from re-establishing which after a number of cycles can cause TCP connections to close while the test is running. So extend the delay between suspend calls to 3 seconds to let the connections stay alive. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-05-26selftests/timers: Make git ignore all binaries in timers test suiteZhang Zhen1-0/+18
This patch includes the timers test binaries into the .gitignore file listing in their respective directories. This will make sure that git ignores all of these test binaries when displaying status. Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-04-02kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARMJohn Stultz1-0/+7
The set-timer-lat test fails when testing CLOCK_BOOTTIME_ALARM or CLOCK_REALTIME_ALARM when the user isn't running as root or with CAP_WAKE_ALARM. So this patch improves the error checking so we report the issue more clearly and continue rather then reporting a failure. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-31kselftests: timers: Reduce default runtime on inconsistency-check and set-timer-latJohn Stultz2-2/+2
For the default run_timers target, the timers tests takes the majority of kselftests runtime. So this patch reduces the default runtime for inconsistentcy-check and set-timer-lat, which reduced the runtime almost in half. Before: 11m48.629s After: 6m47.723s Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-24tools, update rtctest.c to verify passage of timePrarit Bhargava1-0/+13
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>
2015-03-24Documentation, split up rtc.txt into documentation and test filePrarit Bhargava2-1/+259
This patch splits rtc.txt into two separate files, one for the documentation itself, and the other for the rtctest.c file. The rtctest file is moved into the kernel tools/testing/selftests/timers directory. This will make automated testing easier. Note that the only difference in the rtc.txt file is that the location of the rtctest.c file has changed. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Jonathan Corbet <corbet@lwn.net> 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>
2015-03-19selftests/timers: Use shared logic to run and install testsMichael Ellerman1-15/+12
Change the timers Makefile to make use of shared run and install logic in lib.mk. Destructive tests are installed but not run by default. Add a new variable, TEST_PROGS_EXTENDED, which is a list of extra programs to install, but which are not run by the default run_tests logic. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-19kselftest/timers: Set default threadtest values to simplify execution scriptsJohn Stultz1-2/+6
In order to keep the kselftest Makefiles simpler, set the threadtest default values to the ones used in standard run_tests Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add set-2038 test from timetest suiteJohn Stultz2-1/+146
Adds the set-2038 test which sets the time to near-edge cases like the start and end of the 32 bit epoch and checks that time behaves properly. There is also a dangerous mode, which lets the clock roll over past 2038 on 32bit systems, which on some older kernels will cause system hangs. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add set-tai from the timetest suiteJohn Stultz2-1/+81
This patch adds the set-tai test which ensures the tai offset can be set properly from adjtimex. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add leapcrash test from the timetest suiteJohn Stultz2-1/+122
This change adds the leapcrash test which tests to see if a leapsecond deadlock which was observed from 2.6.26 to 3.3 is present on this system. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add leap-a-day test from timetest suiteJohn Stultz2-0/+321
This change adds the leap-a-day test which sets STA_INS and STA_DEL each day to trigger leapseconds each day. It also has a mode to jump the time to right before the end of the day each iteration. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add clocksource-switch test from timetest suiteJohn Stultz2-1/+181
Adds the clocksource-switch tests which continually switches the current clocksource between all the available ones, watching for any timekeeping inconsistencies. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add skew_consistency test from the timetests suiteJohn Stultz2-1/+91
This change adds the skew_consistency test, which twists the ADJ_FREQUENCY knob back and forth and watches for timekeeping inconsistencies. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add change_skew test from timetest suiteJohn Stultz2-1/+109
This patch adds the change_skew test which validates the adjtimex freq can be set to various values and then using the inconsistency-check, raw_skew, and nanosleep tests ensures time behaves properly. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add alarmtimer-suspend test from timetests suiteJohn Stultz2-2/+189
This adds the alarmtimer-suspend test from the timetests suite, which tests that the alarmtimers wake the system up from suspend shortly after the time they were set to fire. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add adjtimex validation test from timetest suiteJohn Stultz2-1/+212
This adds a adjtimex validation test which checks the behavior for a set of valida and invalid inputs. So far this only tests ADJ_FREQUENCY, but hopefully will grow. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add mqueue latency test from the timetest suiteJohn Stultz2-1/+126
Add test to validate mqueue timeout latency from the timetest suite Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-12selftests/timers: Add threaded time inconsistency test from timetest suiteJohn Stultz2-2/+202
Add the threaded time inconsistency test from the timetest suite. This checks for time inconsistencies between cpus, usually associated with clock skew as sometimes found w/ TSCs. Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>