From: Xunlei Pang <xlpang@126.com>
To: linux-kernel@vger.kernel.org
Cc: rtc-linux@googlegroups.com, Thomas Gleixner <tglx@linutronix.de>,
Alessandro Zummo <a.zummo@towertech.it>,
John Stultz <john.stultz@linaro.org>,
Arnd Bergmann <arnd.bergmann@linaro.org>,
linux-omap@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
linux-tegra@vger.kernel.org,
Stephen Warren <swarren@wwwdotorg.org>,
linux390@de.ibm.com, Martin Schwidefsky <schwidefsky@de.ibm.com>,
Ralf Baechle <ralf@linux-mips.org>, Arnd Bergmann <arnd@arndb.de>,
Xunlei Pang <pang.xunlei@linaro.org>
Subject: [PATCH 0/8] Add y2038 safe replacements for read_boot_clock(), read_persistent_clock() and update_persistent_clock()
Date: Wed, 11 Mar 2015 11:15:07 +0800 [thread overview]
Message-ID: <1426043715-22043-1-git-send-email-xlpang@126.com> (raw)
From: Xunlei Pang <pang.xunlei@linaro.org>
read_boot_clock(), read_persistent_clock() and update_persistent_clock()
all use timespec which may have "y2038 problem", thus we are planning on
converting all of them to use timespec64.
The approach we're using is:
1) First of all, add the "__weak" implementaion of xxx_clock64() which uses
xxx_clock() and timespec64.
Let's take read_persistent_clock() as an example. We can create its
y2038-safe version below:
void __weak read_persistent_clock64(struct timespec64 *ts64)
{
struct timespec ts;
read_persistent_clock(&ts);
*ts64 = timespec_to_timespec64(ts);
}
Then, replace all the call sites of xxx_clock() with xxx_clock64() except
the one used by xxx_clock64().
2) Convert every architecture specific xxx_clock() to xxx_clock64() one by one.
At this point, we can convert the three functions at a time if needed, because
most time they're correlated.
3) Remove xxx_clock() after all its architecture specific implementations have been
converted to use corresponding y2038 safe xxx_clock64().
This patchset firstly finished the step1 for all the three functions, then focused
on read_boot_clock() which is simple to go on with step2 and step3 as a whole show.
As for read_persistent_clock() and update_persistent_clock() which are more complex,
requiring many efforts to convert every architecture specific implementation gradually.
The approach used here is Suggested-by: "Arnd Bergmann <arnd@arndb.de>"
Xunlei Pang (8):
time: Add y2038 safe read_boot_clock64()
time: Add y2038 safe read_persistent_clock64()
time: Add y2038 safe update_persistent_clock64()
ARM: OMAP: 32k counter: Provide y2038-safe
omap_read_persistent_clock() replacement
ARM: tegra: clock: Provide y2038-safe tegra_read_persistent_clock()
replacement
ARM: time: Provide read_boot_clock64() and read_persistent_clock64()
s390: time: Provide read_boot_clock64() and read_persistent_clock64()
time: Remove read_boot_clock()
arch/arm/include/asm/mach/time.h | 3 +--
arch/arm/kernel/time.c | 6 +++---
arch/arm/plat-omap/counter_32k.c | 18 ++++++------------
arch/mips/lasat/sysctl.c | 4 ++--
arch/s390/include/asm/timex.h | 4 ++--
arch/s390/kernel/debug.c | 4 ++--
arch/s390/kernel/time.c | 6 +++---
drivers/clocksource/tegra20_timer.c | 15 +++++++--------
drivers/rtc/systohc.c | 2 +-
include/linux/timekeeping.h | 4 +++-
kernel/time/ntp.c | 13 ++++++++++++-
kernel/time/timekeeping.c | 31 ++++++++++++++++---------------
12 files changed, 58 insertions(+), 52 deletions(-)
--
1.9.1
next reply other threads:[~2015-03-11 3:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 3:15 Xunlei Pang [this message]
2015-03-11 3:15 ` [PATCH 1/8] time: Add y2038 safe read_boot_clock64() Xunlei Pang
[not found] ` <OF2C7428FA.095162DD-ON48257E0C.004641E0-48257E0C.004652BC@zte.com.cn>
2015-03-18 16:30 ` John Stultz
2015-03-11 3:15 ` [PATCH 2/8] time: Add y2038 safe read_persistent_clock64() Xunlei Pang
2015-03-11 3:15 ` [PATCH 3/8] time: Add y2038 safe update_persistent_clock64() Xunlei Pang
2015-03-11 3:15 ` [PATCH 4/8] ARM: OMAP: 32k counter: Provide y2038-safe omap_read_persistent_clock() replacement Xunlei Pang
2015-03-11 15:28 ` Tony Lindgren
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=1426043715-22043-1-git-send-email-xlpang@126.com \
--to=xlpang@126.com \
--cc=a.zummo@towertech.it \
--cc=arnd.bergmann@linaro.org \
--cc=arnd@arndb.de \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=pang.xunlei@linaro.org \
--cc=ralf@linux-mips.org \
--cc=rtc-linux@googlegroups.com \
--cc=schwidefsky@de.ibm.com \
--cc=swarren@wwwdotorg.org \
--cc=tglx@linutronix.de \
--cc=tony@atomide.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
all inboxes | Powered by JetHome®