Re: [PATCH 07/12] rtc: rzn1: fix alarm range check truncation on 32-bit systems

From: Wolfram Sang

Date: Wed Jul 01 2026 - 07:02:16 EST


Hi Prabhakar,

So, when I improved this driver back then, 'rtctest' from within the
kernel was my reference. This test still passes with the current kernel.
However, setting an alarm one day in the future does not work for me. It
just stays the old alarm. Without your patch series, that is. So, I
think this issue should not affect your series. Especially if you can
set an alarm more than one day in the future (and less than a week, of
course, because of the HW limit). Can you? I recall I had issues with
RTC programs compiled against uclibc. Despite I am sure I used a
glibc-compiled version of the rtc-tools, I need to investigate this. But
not now, but somewhen. I have to take care of other issues first. Let's
assume for now that I am the problem.

> I ran some tests for cases #1 and #2, and we see an out-of-range
> error. By adding a 1-sec leeway when checking the ranges I don't get
> the out-of-range error. Let me know what you think (I'll create a
> seprate patch for it).

From a glimpse, I think -ERANGE is correct. Increasing the already
calculated 'farest' doesn't sound like a good idea to me TBH, unless I
am missing something.

Happy hacking,

Wolfram

Attachment: signature.asc
Description: PGP signature