aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/rtc/rtctest.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-11-15selftests: rtc: skip when RTC is not presentAlexandre Belloni1-1/+32
There is no point in failing the tests when RTC is not present. Reported-by: Linux Kernel Functional Testing <lkft@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Tested-by: Daniel Diaz <daniel.diaz@linaro.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-25selftests/rtc: continuously read RTC in a loop for 30sMateusz Jończyk1-0/+66
Some problems with reading the RTC time may happen rarely, for example while the RTC is updating. So read the RTC many times to catch these problems. For example, a previous attempt for my commit ea6fa4961aab ("rtc: mc146818-lib: fix RTC presence check") was incorrect and would have triggered this selftest. To avoid the risk of damaging the hardware, wait 11ms before consecutive reads. In rtc_time_to_timestamp I copied values manually instead of casting - just to be on the safe side. The 11ms wait period was chosen so that it is not a divisor of 1000ms. Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-05-24selftests: rtc: rtctest: specify timeoutsAlexandre Belloni1-3/+3
uie_read is a commonly failing test that will block forever on buggy rtc drivers. Shorten its timeout so it fails earlier. Also increase the timeout for the two alarm test on a minute boundary. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-01-14selftests: rtc: rtctest: add alarm test on minute boundaryAlexandre Belloni1-0/+102
Unfortunately, some RTC don't have a second resolution for alarm so also test for alarm on a minute boundary. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Shuah Khan <shuah@kernel.org>
2019-01-14selftests: rtc: rtctest: fix alarm testsAlexandre Belloni1-5/+2
Return values for select are not checked properly and timeouts may not be detected. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Shuah Khan <shuah@kernel.org>
2018-05-30selftests: rtc: rework rtctestAlexandre Belloni1-281/+191
Rework rtctest to use the test harness to better handle skipping tests (e.g. when alarms are not available). Also, it now handles timeout so it will not block expecting an alarm that never comes. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: move RTC tests to rtc subfolderAlexandre Belloni1-0/+328
Move the RTC tests out of the timers folder as they are mostly unrelated. Keep rtcpie in timers as it only test hrtimers. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>