[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=XrF0RcNwoyJr4c6Qg1H0sAfjYX3xcWHfO5ECt+TQuK5A@mail.gmail.com>
Date: Fri, 18 Dec 2015 16:26:46 -0800
From: Doug Anderson <dianders@...omium.org>
To: Julius Werner <jwerner@...omium.org>
Cc: Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Alessandro Zummo <a.zummo@...ertech.it>,
Sonny Rao <sonnyrao@...omium.org>,
Chris Zhong <zyw@...k-chips.com>,
Heiko Stuebner <heiko@...ech.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
rtc-linux@...glegroups.com
Subject: Re: [PATCHv3] RTC: RK808: Compensate for Rockchip calendar deviation
on November 31st
Julius,
On Tue, Dec 15, 2015 at 3:02 PM, Julius Werner <jwerner@...omium.org> wrote:
> In A.D. 1582 Pope Gregory XIII found that the existing Julian calendar
> insufficiently represented reality, and changed the rules about
> calculating leap years to account for this. Similarly, in A.D. 2013
> Rockchip hardware engineers found that the new Gregorian calendar still
> contained flaws, and that the month of November should be counted up to
> 31 days instead. Unfortunately it takes a long time for calendar changes
> to gain widespread adoption, and just like more than 300 years went by
> before the last Protestant nation implemented Greg's proposal, we will
> have to wait a while until all religions and operating system kernels
> acknowledge the inherent advantages of the Rockchip system. Until then
> we need to translate dates read from (and written to) Rockchip hardware
> back to the Gregorian format.
>
> This patch works by defining Jan 1st, 2016 as the arbitrary anchor date
> on which Rockchip and Gregorian calendars are in sync. From that we can
> translate arbitrary later dates back and forth by counting the number
> of November/December transitons since the anchor date to determine the
> offset between the calendars. We choose this method (rather than trying
> to regularly "correct" the date stored in hardware) since it's the only
> way to ensure perfect time-keeping even if the system may be shut down
> for an unknown number of years. The drawback is that other software
> reading the same hardware (e.g. mainboard firmware) must use the same
> translation convention (including the same anchor date) to be able to
> read and write correct timestamps from/to the RTC.
>
> Signed-off-by: Julius Werner <jwerner@...omium.org>
> ---
> drivers/rtc/rtc-rk808.c | 48 ++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 44 insertions(+), 4 deletions(-)
I'm not terribly worried about the date in the past problem that you
brought up in your own response. So:
Reviewed-by: Douglas Anderson <dianders@...omium.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists