<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/rtc/rtctest.c, branch v6.18.21</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-04-01T13:03:13+00:00</updated>
<entry>
<title>selftest: rtc: skip some tests if the alarm only supports minutes</title>
<updated>2025-04-01T13:03:13+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2025-02-18T10:15:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0cd73ab4df45ed9a78051cfb96a6de48d421852f'/>
<id>urn:sha1:0cd73ab4df45ed9a78051cfb96a6de48d421852f</id>
<content type='text'>
There are alarms which have only minute-granularity. The RTC core
already has a flag to describe them. Use this flag to skip tests which
require the alarm to support seconds.

Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Link: https://lore.kernel.org/r/20250218101548.6514-1-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>selftest: rtc: Add to check rtc alarm status for alarm related test</title>
<updated>2024-10-23T20:13:00+00:00</updated>
<author>
<name>Joseph Jang</name>
<email>jjang@nvidia.com</email>
</author>
<published>2024-10-21T03:22:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a027d6bb66002c8e50e974676f932b33c5fce10'/>
<id>urn:sha1:2a027d6bb66002c8e50e974676f932b33c5fce10</id>
<content type='text'>
In alarm_wkalm_set and alarm_wkalm_set_minute test, they use different
ioctl (RTC_ALM_SET/RTC_WKALM_SET) for alarm feature detection. They will
skip testing if RTC_ALM_SET/RTC_WKALM_SET ioctl returns an EINVAL error
code. This design may miss detecting real problems when the
efi.set_wakeup_time() return errors and then RTC_ALM_SET/RTC_WKALM_SET
ioctl returns an EINVAL error code with RTC_FEATURE_ALARM enabled.

In order to make rtctest more explicit and robust, we propose to use
RTC_PARAM_GET ioctl interface to check rtc alarm feature state before
running alarm related tests. If the kernel does not support RTC_PARAM_GET
ioctl interface, we will fallback to check the error number of
(RTC_ALM_SET/RTC_WKALM_SET) ioctl call for alarm feature detection.

Requires commit 101ca8d05913b ("rtc: efi: Enable SET/GET WAKEUP services
as optional")

Reviewed-by: Koba Ko &lt;kobak@nvidia.com&gt;
Reviewed-by: Matthew R. Ochs &lt;mochs@nvidia.com&gt;
Signed-off-by: Joseph Jang &lt;jjang@nvidia.com&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftest: rtc: Check if could access /dev/rtc0 before testing</title>
<updated>2024-09-30T17:32:07+00:00</updated>
<author>
<name>Joseph Jang</name>
<email>jjang@nvidia.com</email>
</author>
<published>2024-05-24T01:38:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ad999870a86d58246b6a614a435d055a9edf269'/>
<id>urn:sha1:1ad999870a86d58246b6a614a435d055a9edf269</id>
<content type='text'>
The rtctest requires the read permission on /dev/rtc0. The rtctest will
be skipped if the /dev/rtc0 is not readable.

Reviewed-by: Koba Ko &lt;kobak@nvidia.com&gt;
Reviewed-by: Matthew R. Ochs &lt;mochs@nvidia.com&gt;
Signed-off-by: Joseph Jang &lt;jjang@nvidia.com&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: harness: remove unneeded __constructor_order_last()</title>
<updated>2024-08-06T19:40:20+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-07-27T14:37:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a6b6c9a226279b4f6668450ddb21ae655558087'/>
<id>urn:sha1:2a6b6c9a226279b4f6668450ddb21ae655558087</id>
<content type='text'>
__constructor_order_last() is unneeded.

If __constructor_order_last() is not called on backward-order systems,
__constructor_order will remain 0 instead of being set to
_CONSTRUCTOR_ORDER_BACKWARD (= -1).

__LIST_APPEND() will still take the 'else' branch, so there is no
difference in the behavior.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: rtc: skip when RTC is not present</title>
<updated>2022-11-15T20:30:51+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2022-11-15T20:21:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=35eee9a363becb854109e35d568299bafc97c9d1'/>
<id>urn:sha1:35eee9a363becb854109e35d568299bafc97c9d1</id>
<content type='text'>
There is no point in failing the tests when RTC is not present.

Reported-by: Linux Kernel Functional Testing &lt;lkft@linaro.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Tested-by: Daniel Diaz &lt;daniel.diaz@linaro.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/rtc: continuously read RTC in a loop for 30s</title>
<updated>2022-02-26T00:00:51+00:00</updated>
<author>
<name>Mateusz Jończyk</name>
<email>mat.jonczyk@o2.pl</email>
</author>
<published>2022-02-19T07:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2aaa36e95ea586ad23edfcc1d474e8b735a4d1c3'/>
<id>urn:sha1:2aaa36e95ea586ad23edfcc1d474e8b735a4d1c3</id>
<content type='text'>
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 &lt;mat.jonczyk@o2.pl&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: rtc: rtctest: specify timeouts</title>
<updated>2019-05-24T19:39:58+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2019-05-23T22:42:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eff82a263b5cfa3427fd9dbfedd96da94fdc9f19'/>
<id>urn:sha1:eff82a263b5cfa3427fd9dbfedd96da94fdc9f19</id>
<content type='text'>
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 &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: rtc: rtctest: add alarm test on minute boundary</title>
<updated>2019-01-15T01:49:14+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2018-12-18T21:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b3027728f4d4f6763f4d7e771acfc9424cdd0e6'/>
<id>urn:sha1:7b3027728f4d4f6763f4d7e771acfc9424cdd0e6</id>
<content type='text'>
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 &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Shuah Khan &lt;shuah@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: rtc: rtctest: fix alarm tests</title>
<updated>2019-01-15T01:49:05+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2018-12-18T21:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fdac94489c4d247088b3885875b39b3e1eb621ef'/>
<id>urn:sha1:fdac94489c4d247088b3885875b39b3e1eb621ef</id>
<content type='text'>
Return values for select are not checked properly and timeouts may not be
detected.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Shuah Khan &lt;shuah@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: rtc: rework rtctest</title>
<updated>2018-05-30T21:21:51+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2018-04-19T12:50:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d8da8665e8e34c14f9b20fe3f21dff29b24cbf02'/>
<id>urn:sha1:d8da8665e8e34c14f9b20fe3f21dff29b24cbf02</id>
<content type='text'>
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 &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Shuah Khan (Samsung OSG) &lt;shuah@kernel.org&gt;
</content>
</entry>
</feed>
