All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] Add rtc 64bit epoch offset for rtc hardware that only provides 32bit time
@ 2014-11-27 12:02 Xunlei Pang
  2014-11-27 12:02 ` [RFC PATCH 1/4] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t Xunlei Pang
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Xunlei Pang @ 2014-11-27 12:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Sven Schnelle,
	Xunlei Pang, John Stultz, Arnd Bergmann

On some systems the rtc hardware may only provide 32bits of time.
This is problematic, as the hardware won't be able to provide
post-y2038 times to initialize the system at boot.

Thus this patch series provides a 64bit epoch offset, which can be
configured to allow the 32bit rtc hardware to represent times past
2038, and also demonstrates how to use the newly-added interfaces
based on rtc epoch offset to eliminate y2038/y2106 issues existing
in many current rtc drivers despite the above-mentioned rtc hardware
limitations.

Patch 1:
mxc_rtc_set_mmss() is one y2038-unsafe user of rtc_class_ops.set_mmss(),
but it uses get_alarm_or_time()/set_alarm_or_time() internal interfaces
which are also y2038 unsafe. The handling of these two internal interfaces
has enough complexity to require a separate patch, so we process it here
before converting rtc_class_ops.set_mmss() which will be done in Patch 2.
Currently, "mxc" is the only driver with such issue.

Patch 2:
Converts rtc_class_ops.set_mmss() to use time64_t, so lays some groundwork
for making rtc drivers y2038/y2106 safe.

Patch 3:
Provides two new interfaces based on the rtc epoch offset to map between
32bit hardware time and 64bit time. We can use them to make 32bit hardware
rtc drivers y2038/y2106 safe.

Patch 4:
Now thanks to foregoing jobs, it's time to provide an example to demonstrate
how to address all 32bit time issues in a single rtc driver(imxdi) whose
rtc hardware only provides 32bit time.

If there're no objections with my approach, I'll go on with the work
to make all the rtc drivers under "drivers/rtc" y2038/y2106 safe.

NOTE: This patch series relies on the former patch series named:
"y2038 in-kernel interface changes for drivers/rtc".

Cc: John Stultz <john.stultz@linaro.org>
Cc: Arnd Bergmann <arnd.bergmann@linaro.org>

Xunlei Pang (4):
  rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use
    time64_t
  rtc: Convert rtc_class_ops.set_mmss() to use time64_t
  rtc/lib: Provide interfaces to map between 32bit hardware and 64bit
    time
  rtc/imxdi: Update driver to address time issues

 arch/alpha/kernel/rtc.c     |    4 ++--
 drivers/rtc/class.c         |   25 +++++++++++++++++++++++++
 drivers/rtc/interface.c     |    8 ++++----
 drivers/rtc/rtc-ab3100.c    |    4 ++--
 drivers/rtc/rtc-coh901331.c |    8 +++++++-
 drivers/rtc/rtc-ds1672.c    |    8 +++++++-
 drivers/rtc/rtc-ds2404.c    |    9 ++++++++-
 drivers/rtc/rtc-ep93xx.c    |    8 +++++++-
 drivers/rtc/rtc-imxdi.c     |   37 ++++++++++++++++++++++---------------
 drivers/rtc/rtc-jz4740.c    |    8 +++++++-
 drivers/rtc/rtc-lib.c       |   28 ++++++++++++++++++++++++++++
 drivers/rtc/rtc-lpc32xx.c   |    9 ++++++++-
 drivers/rtc/rtc-mc13xxx.c   |    5 ++---
 drivers/rtc/rtc-mxc.c       |   37 ++++++++++++++++++-------------------
 drivers/rtc/rtc-pcap.c      |    6 ++----
 drivers/rtc/rtc-stmp3xxx.c  |    8 +++++++-
 drivers/rtc/rtc-test.c      |    4 ++--
 drivers/rtc/rtc-tx4939.c    |    8 +++++++-
 drivers/rtc/rtc-wm831x.c    |   16 +++++++++-------
 drivers/rtc/rtc-xgene.c     |    6 +++++-
 include/linux/rtc.h         |    5 ++++-
 21 files changed, 183 insertions(+), 68 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-12-01 21:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-27 12:02 [RFC PATCH 0/4] Add rtc 64bit epoch offset for rtc hardware that only provides 32bit time Xunlei Pang
2014-11-27 12:02 ` [RFC PATCH 1/4] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t Xunlei Pang
2014-11-27 23:02   ` Thomas Gleixner
2014-11-27 23:47     ` Arnd Bergmann
2014-11-28 15:58       ` pang.xunlei
2014-11-27 12:02 ` [RFC PATCH 2/4] rtc: Convert rtc_class_ops.set_mmss() " Xunlei Pang
2014-11-27 23:05   ` Thomas Gleixner
2014-11-27 23:23     ` Arnd Bergmann
2014-11-27 23:28       ` Thomas Gleixner
2014-11-28 16:49   ` pang.xunlei
2014-11-27 12:02 ` [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time Xunlei Pang
2014-11-27 23:16   ` Thomas Gleixner
2014-11-28 16:10     ` pang.xunlei
2014-12-01 21:12       ` Thomas Gleixner
2014-11-27 12:02 ` [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues Xunlei Pang
2014-11-27 23:24   ` Thomas Gleixner
2014-11-28 16:20     ` pang.xunlei
2014-12-01  0:13       ` Alessandro Zummo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.