[LTP] [PATCH v2 0/2] rtc02: handle RTCs that do not allow setting the time
Kuba Pawlak
kuba.pawlak@canonical.com
Mon Jul 20 16:44:47 CEST 2026
Note: I forgot to include a cover letter when sending this v2 series.
Adding the intended cover-letter text here for context.
This series makes LTP's rtc02 cope with RTC hardware that does not allow
setting the time (e.g. Qualcomm PMIC RTCs, rtc-pm8xxx, which return -ENODEV
from RTC_SET_TIME when configured without allow-set-time or an nvmem/UEFI
offset). On such devices rtc02 currently fails a valid, working system.
Patch 1 fixes a pre-existing fd leak in tst_rtc_ioctl() that the new probe
in patch 2 would otherwise hit on every run (the RTC chardev is
exclusive-open, so the leak causes a follow-up EBUSY). Patch 2 probes
set-time support in setup and skips with TCONF when RTC_SET_TIME returns
ENODEV.
Changes since v1:
- Narrowed the skip condition from a broad errno set to ENODEV only, as
EINVAL and others are used too widely by the kernel to treat as
"not supported" (per review feedback).
- Added patch 1 to fix the pre-existing fd leak on the ioctl() error
path, which the probe now exercises routinely.
Tested on arm64:
- QCS8300 (read-only RTC): rtc02 now TCONF (skipped), was TFAIL.
- X1E80100 (writable RTC): rtc02 still TPASS.
More information about the ltp
mailing list