All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 0/2] rtc02: handle RTCs that do not allow setting the time
@ 2026-07-23  9:49 Kuba Pawlak via ltp
  2026-07-23  9:49 ` [LTP] [PATCH v3 1/2] lib: tst_rtctime: close RTC fd on the ioctl() error path Kuba Pawlak via ltp
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kuba Pawlak via ltp @ 2026-07-23  9:49 UTC (permalink / raw)
  To: ltp

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.

Tested on arm64:
  - QCS8300 (read-only RTC): rtc02 now TCONF (skipped), was TFAIL.
  - X1E80100 (writable RTC): rtc02 still TPASS.

Changes since v2:
  - patch 1: drop the errno save/restore around SAFE_CLOSE(); a successful
    close() does not clobber errno, and if SAFE_CLOSE() fails the test
    breaks anyway (Andrea Cervesato).
  - patch 2: drop the long explanatory comment and let the commit message
    and code speak for themselves; add a blank line between the RTC_RD_TIME
    and RTC_SET_TIME probes (Andrea Cervesato).

Link to v2:
  https://lists.linux.it/pipermail/ltp/2026-July/049974.html

Kuba Pawlak (2):
  lib: tst_rtctime: close RTC fd on the ioctl() error path
  rtc02: skip (TCONF) on read-only RTCs that reject RTC_SET_TIME

 lib/tst_rtctime.c                           |  7 ++++---
 testcases/kernel/device-drivers/rtc/rtc02.c | 11 +++++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-27 14:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23  9:49 [LTP] [PATCH v3 0/2] rtc02: handle RTCs that do not allow setting the time Kuba Pawlak via ltp
2026-07-23  9:49 ` [LTP] [PATCH v3 1/2] lib: tst_rtctime: close RTC fd on the ioctl() error path Kuba Pawlak via ltp
2026-07-23 11:14   ` [LTP] " linuxtestproject.agent
2026-07-23  9:49 ` [LTP] [PATCH v3 2/2] rtc02: skip (TCONF) on read-only RTCs that reject RTC_SET_TIME Kuba Pawlak via ltp
2026-07-27 14:11 ` [LTP] [PATCH v3 0/2] rtc02: handle RTCs that do not allow setting the time Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.