memesearch
Rockchip Calendar November 31st

Rockchip Calendar November 31st

Download Find similar pictures
Text on the meme
rtc: rk808: Compensate for Rockchip calendar deviation on November 31st 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 applications 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 translate arbitrary later dates back and forth by counting the number of November/December transitions 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@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Diffstat -1W-r--- drivers/rtc/rtc-rk808.c 48 1 files changed, 44 insertions, 4 deletions diff --git a/drivers/rtc/rtc-rk808.c b/drivers/rtc/rtc-rk808.c index 91ca0bc1b484b..35c9aada07c8e 100644 --- a/drivers/rtc/rtc-rk808.c +++ b/drivers/rtc/rtc-rk808.c @@ -56,6 +56,42 @@ struct rk808_rtc { }; +/* + * The Rockchip calendar used by the RK808 counts November with 31 days. We use + * these translation functions to convert our dates to/from the Gregorian + * calendar used by the rest of the world. We arbitrarily define Jan 1st, 2016 + * as the day when both calendars were in sync, and treat all other dates + * relative to that. + * NOTE: Other system software (e.g. firmware) that reads the same hardware must + * implement this exact same conversion algorithm, with the same anchor date. + */ +static time64_t nov2dec_transitions(struct rtc_time *tm) +{
What it means

A screenshot of a Linux kernel patch for the Rockchip RK808 real-time clock. The patch jokingly treats November as having 31 days and invents a separate Rockchip calendar that must be translated to the Gregorian calendar. The punchline is the completely serious-looking technical solution to an absurd hardware datekeeping bug, making it a classic programmer in-joke about broken firmware and impossible calendar dates.

Objects
Tags
Sources
Type
image
Size
592×800 · 148.3 KiB
Mood
absurd, sarcastic
Language
en
Added

Similar memes