History log of /linux-master/tools/testing/selftests/rtc/rtctest.c
Revision Date Author Comments
# 35eee9a3 15-Nov-2022 Alexandre Belloni <alexandre.belloni@bootlin.com>

selftests: rtc: skip when RTC is not present

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>


# 2aaa36e9 19-Feb-2022 Mateusz Jończyk <mat.jonczyk@o2.pl>

selftests/rtc: continuously read RTC in a loop for 30s

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>


# eff82a26 23-May-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

selftests: rtc: rtctest: specify timeouts

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>


# 7b302772 18-Dec-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

selftests: rtc: rtctest: add alarm test on minute boundary

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>


# fdac9448 18-Dec-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

selftests: rtc: rtctest: fix alarm tests

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>


# d8da8665 19-Apr-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

selftests: rtc: rework rtctest

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>


# a12ab9e1 19-Apr-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

selftests: move RTC tests to rtc subfolder

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>