Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Kuba Pawlak via ltp" <ltp@lists.linux.it>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 2/2] rtc02: skip (TCONF) on read-only RTCs that reject RTC_SET_TIME
Date: Tue, 21 Jul 2026 13:14:39 +0000	[thread overview]
Message-ID: <6a5f70c0.bf927062.8cfc4.ec82@mx.google.com> (raw)
In-Reply-To: <20260717102000.1318116-2-kuba.pawlak@canonical.com>

Hi Kuba,

> +	/*
> +	 * Skip on RTCs that do not allow setting the time, e.g. Qualcomm PMIC
> +	 * RTCs without allow-set-time or an nvmem offset, where RTC_SET_TIME
> +	 * returns -ENODEV. Probe with the current time so a writable RTC is
> +	 * left unchanged, and skip here (before tst_rtc_clock_save()) so the
> +	 * cleanup restore does not fail on such devices.
> +	 *
> +	 * Only ENODEV is treated as "not supported" here. Wider errnos such as
> +	 * EINVAL are used broadly by the kernel and could mask a genuine
> +	 * failure, so let anything else fall through to TBROK.
> +	 */

Please don't add more info than what we already need. The git commit
already explains why we have this change and the change talks by itself:
we need to verify if RTC is enabled or not.

> +	if (tst_rtc_gettime(rtc_dev, &probe_tm))
> +		tst_brk(TBROK | TERRNO, "ioctl() RTC_RD_TIME");

Space here.

> +	if (tst_rtc_settime(rtc_dev, &probe_tm)) {
> +		if (errno == ENODEV)
> +			tst_brk(TCONF | TERRNO,
> +				"RTC does not support setting the time");

Move it in one line.

> +		tst_brk(TBROK | TERRNO, "ioctl() RTC_SET_TIME");
> +	}
> +
>  	tst_rtc_clock_save(rtc_dev);
>  }

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

  reply	other threads:[~2026-07-21 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 10:19 [LTP] [PATCH v2 1/2] lib: tst_rtctime: close RTC fd on the ioctl() error path Kuba Pawlak via ltp
2026-07-17 10:20 ` [LTP] [PATCH v2 2/2] rtc02: skip (TCONF) on read-only RTCs that reject RTC_SET_TIME Kuba Pawlak via ltp
2026-07-21 13:14   ` Andrea Cervesato via ltp [this message]
2026-07-17 11:26 ` [LTP] lib: tst_rtctime: close RTC fd on the ioctl() error path linuxtestproject.agent
2026-07-20 14:44 ` [LTP] [PATCH v2 0/2] rtc02: handle RTCs that do not allow setting the time Kuba Pawlak via ltp
2026-07-21 13:02 ` [LTP] [PATCH v2 1/2] lib: tst_rtctime: close RTC fd on the ioctl() error path Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a5f70c0.bf927062.8cfc4.ec82@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox