]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms
authorShuah Khan <shuahkh@osg.samsung.com>
Thu, 21 Sep 2017 19:05:18 +0000 (13:05 -0600)
committerShuah Khan <shuahkh@osg.samsung.com>
Mon, 25 Sep 2017 16:09:07 +0000 (10:09 -0600)
commitdcdac88800b47bc18d63f31adaa0154955685ca3
tree0ff7cd4c9d969e3f41263fdfc33c9c08ebd8af0a
parent40b06e4b47ce7acaa9648e93a5ecaa16c179a0b4
selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms

When timer_create() fails on a bootime or realtime clock, setup_timer()
returns 0 as if timer has been set. Callers wait forever for the timer
to expire.

This hang is seen on a system that doesn't have support for:

CLOCK_REALTIME_ALARM   ABSTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED]

Test hangs waiting for a timer that hasn't been set to expire. Fix
setup_timer() to return 1, add handling in callers to detect the
unsupported case and return 0 without waiting to not fail the test.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/timers/set-timer-lat.c