[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5gpvxwgqfgvb6eu6nwso3xk4xpdqayz7wo6y2mvweci2veetqw@wsurri5h7xvu>
Date: Mon, 28 Apr 2025 18:59:33 +0200
From: Uwe Kleine-König <u.kleine-koenig@...libre.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Alexandre Mergnat <amergnat@...libre.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>, linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, Macpaul Lin <macpaul.lin@...iatek.com>
Subject: Re: [PATCH v4 1/5] rtc: Make rtc_time64_to_tm() support dates before
1970
Hello Alexandre,
On Mon, Apr 28, 2025 at 12:06:47PM +0200, Alexandre Mergnat wrote:
> Conversion of dates before 1970 is still relevant today because these
> dates are reused on some hardwares to store dates bigger than the
> maximal date that is representable in the device's native format.
> This prominently and very soon affects the hardware covered by the
> rtc-mt6397 driver that can only natively store dates in the interval
> 1900-01-01 up to 2027-12-31. So to store the date 2028-01-01 00:00:00
> to such a device, rtc_time64_to_tm() must do the right thing for
> time=-2208988800.
>
> Signed-off-by: Alexandre Mergnat <amergnat@...libre.com>
Given this problem starts to bite in 2028 I'd like to see this (and the
next) patch backported to stable. If you want a Fixes: line, maybe
34bbdc12d04e ("rtc: mt6359: Add RTC hardware range and add support for
start-year") is sensible here as this is the commit that introduced the
requirement to handle negative timestamps. (The drivers that made use
of the offset feature already before that commit all had
.range_min >= 0, and so are not affected by this problem.)
With my Debian kernel team member hat on, I even welcome
34bbdc12d04e2f18a2ca96351c59e40b62da3314 being backported to 6.12.y
given that the next Debian stable release ("trixie") will use 6.12.y and
will likely matter longer than 2027.
Apart from that:
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@...libre.com>
Best regards
Uwe
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists