Commit 2a027d6b authored by Joseph Jang's avatar Joseph Jang Committed by Shuah Khan
Browse files

selftest: rtc: Add to check rtc alarm status for alarm related test



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 101ca8d0 ("rtc: efi: Enable SET/GET WAKEUP services
as optional")

Reviewed-by: default avatarKoba Ko <kobak@nvidia.com>
Reviewed-by: default avatarMatthew R. Ochs <mochs@nvidia.com>
Signed-off-by: default avatarJoseph Jang <jjang@nvidia.com>
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent ecfe6870
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment