From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Michel Pollet <michel.pollet@bp.renesas.com>,
linux-rtc@vger.kernel.org
Subject: Re: [PATCH] rtc: rzn1: fix BCD to rtc_time conversion errors
Date: Wed, 13 Nov 2024 12:44:39 +0100 [thread overview]
Message-ID: <ZzSRJ_rH5oQfzYO1@ninjato> (raw)
In-Reply-To: <20241113113032.27409-1-wsa+renesas@sang-engineering.com>
[-- Attachment #1: Type: text/plain, Size: 886 bytes --]
On Wed, Nov 13, 2024 at 12:30:32PM +0100, Wolfram Sang wrote:
> tm_mon describes months from 0 to 11, but the register contains BCD from
> 1 to 12. tm_year contains years since 1900, but the BCD contains 20XX.
> Apply the offsets when converting these numbers.
>
> Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Forgot to add that Biju Das had a nice test case for the months:
Steps to reproduce:
------------------
date -s "2016-12-31 23:59:55";hwclock -w
hwclock; sleep 10; hwclock
Original result:
---------------
Sat Dec 31 23:59:55 UTC 2016
Sat Dec 31 23:59:55 2016 0.000000 seconds
hwclock: RTC_RD_TIME: Invalid argument
Result after the fix:
--------------------
Sat Dec 31 23:59:55 2016 0.000000 seconds
Sun Jan 1 00:00:05 2017 0.000000 seconds
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-11-13 11:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 11:30 [PATCH] rtc: rzn1: fix BCD to rtc_time conversion errors Wolfram Sang
2024-11-13 11:44 ` Wolfram Sang [this message]
2024-11-15 19:36 ` Miquel Raynal
2024-11-18 9:30 ` Wolfram Sang
2024-11-18 11:12 ` Alexandre Belloni
2024-11-18 11:12 ` Alexandre Belloni
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=ZzSRJ_rH5oQfzYO1@ninjato \
--to=wsa+renesas@sang-engineering.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=michel.pollet@bp.renesas.com \
--cc=miquel.raynal@bootlin.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