Linux 4.17 Change To Allow RTCs To Live Beyond Their Intended Life

Written by Michael Larabel in Hardware on 9 April 2018 at 08:30 PM EDT. 12 Comments
The "real-time clock" (RTC) changes usually aren't too notable to the Linux kernel merge windows, but for the in-development Linux 4.17 kernel to prolong their life for decades to come, at least as far as the clock is concerned.

There still is the Year 2038 problem being dealt with across different parts of the Linux kernel as the most pressing and time sensitive Linux "Y2K"-like problem currently being tackled, but real-time clocks are also going to rollover at some point, assuming the hardware lasts that long. Kernel developers auditing the RTC drivers discovered that one RTC expired already in 2017, seven more drivers will expire before Year 2038, another 23 drivers will expire before Year 2069, 72 RTC drivers will expire by Year 2100, and 104 drivers will expire by Year 2106.

While some of these RTC drivers may not see their clocks turnover for close to a century, kernel developers have a solution in place that should be practical for those expiring sooner than that. With Linux 4.17 is an RTC offset API to be able to provide a defined offset to the RTC time, in order to extend the supported range of these real-time clocks. The RTC offset API allows for a time to be added when reading from hardware and subtracting when writing back. With that, the supported time-range can be shifted in the kernel for dealing with times past the intended RTC lifespan.

As part of this offset work is also an RTC range API for drivers to inform the Linux kernel core about supported time/date range.The RTC core code also now handles time_t overflows on 32-bit platforms rather than punting it off to the driver.

The Linux 4.17 RTC changes are outlined via this mailing list post.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week