From: Arnd Bergmann <arnd@arndb.de>
To: pang.xunlei@zte.com.cn
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Andrew Christian <andrew.christian@hp.com>,
CIH <cih@coventive.com>, John Stultz <john.stultz@linaro.org>,
linux-kernel@vger.kernel.org, Nicolas Pitre <nico@fluxnic.net>,
Xunlei Pang <pang.xunlei@linaro.org>,
Richard Purdie <rpurdie@rpsys.net>,
rtc-linux@googlegroups.com, Xunlei Pang <xlpang@126.com>
Subject: Re: [5/5] drivers/rtc/sa1100: Replace deprecated rtc_tm_to_time() and rtc_time_to_tm()
Date: Mon, 01 Jun 2015 21:43:22 +0200 [thread overview]
Message-ID: <3404495.679z0IaaBp@wuerfel> (raw)
In-Reply-To: <OF8AF02B38.A9E97627-ON48257E55.00352B8F-48257E55.0037661B@zte.com.cn>
On Saturday 30 May 2015 18:05:10 pang.xunlei@zte.com.cn wrote:
> PangXunLei10110855/user/zte_ltd wrote 2015-05-29 PM 10:32:15:
> > Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote
> > 2015-04-30 AM 07:28:24:
> > > Re: [5/5] drivers/rtc/sa1100: Replace deprecated rtc_tm_to_time()
> > > and rtc_time_to_tm()
> > >
> > > For the same reason that Russell pointed in patch 4/5, this hides that
> > > it doesn't work after 2106-02-07 06:28:16 as the register is still 32
> > > bits.
> > > I would prefer that you return an error in that case.
> >
> > Thanks for the review, I want to leave the ones like this untouched.
> >
>
> To further explain, for the rtc hardware with 32-bit counters, we actually
>
> had a solution before: https://lkml.org/lkml/2014/11/27/341
>
> But seems some guys don't like the solution, so rtc drivers like this one
> can't be simply changed to use the new-added y2038-safe interfaces.
>
> Maybe those drivers will still retain the deprecated interfaces until a
> better solution is proposed.
Note that Alexandre has stepped up as a new maintainer for RTC now,
so whatever he wants is probably the way it should be done.
I think the way that your first approach came out was a bit unfortunate,
because we didn't have agreement on how it should really be done.
IMHO the rtc_time64_to_hw32 and rtc_hw32_to_time64 interfaces were a
good concept, most importantly so we can easily find where the potential
problems are, but the implementation was a bit too ambitious in trying
to fix the underlying issue.
If we want to start this over again, I think a better approach would be
to introduce trivial functions at first, like
time64_t rtc_hw32_to_time64(u32 hwtime)
{
/*
* this is safe until about 2106, when unsigned u32 seconds from the
* 1970 epoch will overflow
*/
return (u64)hwtime;
}
EXPORT_SYMBOL_GPL(rtc_hw32_to_time64);
This way, we can fix all the drivers without introducing any possible
ambiguity and later decide how that function should in fact handle the
2106 overflow. Our grandchildren can take care of that if necessary ;-)
Arnd
next prev parent reply other threads:[~2015-06-01 19:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 9:20 [PATCH 1/5] drivers/rtc/pcf8563: Replace deprecated rtc_time_to_tm() and rtc_tm_to_time() Xunlei Pang
2015-04-15 9:20 ` [PATCH 2/5] drivers/rtc/isl1208: Replace deprecated rtc_tm_to_time() Xunlei Pang
2015-04-15 9:20 ` [PATCH 3/5] drivers/rtc/sunxi: " Xunlei Pang
2015-04-15 9:20 ` [PATCH 4/5] drivers/rtc/pl030: Replace deprecated rtc_tm_to_time() and rtc_time_to_tm() Xunlei Pang
2015-04-15 9:35 ` Russell King - ARM Linux
2015-04-15 9:20 ` [PATCH 5/5] drivers/rtc/sa1100: " Xunlei Pang
2015-04-29 23:28 ` [5/5] " Alexandre Belloni
[not found] ` <OF1F6D43BC.C38481A0-ON48257E54.004FA90B-48257E54.004FD9D8@LocalDomain>
[not found] ` <OF8AF02B38.A9E97627-ON48257E55.00352B8F-48257E55.0037661B@zte.com.cn>
2015-06-01 19:43 ` Arnd Bergmann [this message]
2015-06-01 19:59 ` Alexandre Belloni
2015-06-03 14:17 ` Alessandro Zummo
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=3404495.679z0IaaBp@wuerfel \
--to=arnd@arndb.de \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=andrew.christian@hp.com \
--cc=cih@coventive.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nico@fluxnic.net \
--cc=pang.xunlei@linaro.org \
--cc=pang.xunlei@zte.com.cn \
--cc=rpurdie@rpsys.net \
--cc=rtc-linux@googlegroups.com \
--cc=xlpang@126.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