linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-rtc@vger.kernel.org,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Brandt <chris.brandt@renesas.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 3/3] rtc: sh: set range
Date: Fri, 22 Mar 2019 07:12:07 +0100	[thread overview]
Message-ID: <20190322061207.GV29054@piout.net> (raw)
In-Reply-To: <CAMuHMdUOigr35gDjDNACkk2L4Cq-HQ=TtBAKGLiAhsmcVPOhSQ@mail.gmail.com>

On 21/03/2019 11:22:26+0100, Geert Uytterhoeven wrote:
> On Wed, Mar 20, 2019 at 12:30 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> > The SH RTC is a BCD RTC with some version having 4 digits for the year.
> >
> > The range for the RTCs with only 2 digits for the year was unfortunately
> > shifted to handle 1999 to 2098.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > --- a/include/linux/rtc.h
> > +++ b/include/linux/rtc.h
> > @@ -165,6 +165,7 @@ struct rtc_device {
> >  #define RTC_TIMESTAMP_BEGIN_1900       -2208989361LL /* 1900-01-01 00:00:00 */
> 
> mktime64(1900, 1, 1, 0, 0, 0) = -2208988800 ??
> 
> Is this due to leap seconds, and mktime64() is valid for 1970 and later only?
> 

That's a bug, it seems I didn't use the correct timezone when doing the
calculation. Thanks for spotting that, you can send a patch to correct
it or I can do it.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-03-22  6:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 11:30 [PATCH 1/3] rtc: sh: stop resetting time to epoch Alexandre Belloni
2019-03-20 11:30 ` [PATCH 2/3] rtc: sh: fix possible race condition Alexandre Belloni
2019-03-21  9:51   ` Geert Uytterhoeven
2019-03-20 11:30 ` [PATCH 3/3] rtc: sh: set range Alexandre Belloni
2019-03-21 10:22   ` Geert Uytterhoeven
2019-03-22  6:12     ` Alexandre Belloni [this message]
2019-03-22  7:26       ` Geert Uytterhoeven
2019-03-21  9:46 ` [PATCH 1/3] rtc: sh: stop resetting time to epoch Geert Uytterhoeven

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=20190322061207.GV29054@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=chris.brandt@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).