LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
@ 2015-01-20 16:21 Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 1/8] rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement Xunlei Pang
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

This patch series relies on a former patchset[1], it provides y2038/y2106
safe rtc_class_ops.set_mmss64(), and converts some possible users of set_mmss()
to use set_mmss64(), in the hope that making these users(i.e. rtc drivers)
y2038/y2106 safe.

[1] https://lkml.org/lkml/2014/11/18/218
[2] v1: https://lkml.org/lkml/2014/11/27/341
[3] v2: https://lkml.org/lkml/2015/1/13/403

v2->v3:
* Remove get_seconds64(), use ktime_get_real_seconds() to replace get_seconds()
* Refine rtc-test.c

Xunlei Pang (8):
  rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement
  rtc/test: Update driver to address y2038/y2106 issues
  rtc/ab3100: Update driver to address y2038/y2106 issues
  rtc/mc13xxx: Update driver to address y2038/y2106 issues
  rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time
  rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use
    time64_t
  rtc/mxc: Update driver to address y2038/y2106 issues
  alpha: rtc: change to use rtc_class_ops's set_mmss64()

 arch/alpha/kernel/rtc.c   |  8 +++----
 drivers/rtc/interface.c   |  7 +++++-
 drivers/rtc/rtc-ab3100.c  | 55 +++++++++++++++++++++++------------------------
 drivers/rtc/rtc-mc13xxx.c | 32 ++++++++++++---------------
 drivers/rtc/rtc-mxc.c     | 55 +++++++++++++++++------------------------------
 drivers/rtc/rtc-test.c    | 19 ++++++++++++++--
 drivers/rtc/systohc.c     |  5 ++++-
 include/linux/rtc.h       |  1 +
 8 files changed, 93 insertions(+), 89 deletions(-)

-- 
1.9.1


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

* [RFC PATCH v3 1/8] rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 2/8] rtc/test: Update driver to address y2038/y2106 issues Xunlei Pang
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

Currently the rtc_class_op's set_mmss() function takes a 32bit second
value (on 32bit systems), which is problematic for dates past y2038.

This patch provides a safe version named set_mmss64() using y2038 safe
time64_t.

After this patch, set_mmss() is deprecated and all its users will be
fixed to use set_mmss64(), it can be removed when having no users.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/interface.c | 7 ++++++-
 drivers/rtc/systohc.c   | 5 ++++-
 include/linux/rtc.h     | 1 +
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 45bfc28ee..db44df8 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -72,7 +72,10 @@ int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
 		err = -ENODEV;
 	else if (rtc->ops->set_time)
 		err = rtc->ops->set_time(rtc->dev.parent, tm);
-	else if (rtc->ops->set_mmss) {
+	else if (rtc->ops->set_mmss64) {
+		time64_t secs64 = rtc_tm_to_time64(tm);
+		err = rtc->ops->set_mmss64(rtc->dev.parent, secs64);
+	} else if (rtc->ops->set_mmss) {
 		unsigned long secs;
 		err = rtc_tm_to_time(tm, &secs);
 		if (err == 0)
@@ -98,6 +101,8 @@ int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs)
 
 	if (!rtc->ops)
 		err = -ENODEV;
+	else if (rtc->ops->set_mmss64)
+		err = rtc->ops->set_mmss64(rtc->dev.parent, secs);
 	else if (rtc->ops->set_mmss)
 		err = rtc->ops->set_mmss(rtc->dev.parent, secs);
 	else if (rtc->ops->read_time && rtc->ops->set_time) {
diff --git a/drivers/rtc/systohc.c b/drivers/rtc/systohc.c
index bf3e242..e34a07b 100644
--- a/drivers/rtc/systohc.c
+++ b/drivers/rtc/systohc.c
@@ -35,7 +35,10 @@ int rtc_set_ntp_time(struct timespec now)
 	if (rtc) {
 		/* rtc_hctosys exclusively uses UTC, so we call set_time here,
 		 * not set_mmss. */
-		if (rtc->ops && (rtc->ops->set_time || rtc->ops->set_mmss))
+		if (rtc->ops &&
+		    (rtc->ops->set_time ||
+		     rtc->ops->set_mmss64 ||
+		     rtc->ops->set_mmss))
 			err = rtc_set_time(rtc, &tm);
 		rtc_class_close(rtc);
 	}
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 6d6be09..29093da 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -77,6 +77,7 @@ struct rtc_class_ops {
 	int (*read_alarm)(struct device *, struct rtc_wkalrm *);
 	int (*set_alarm)(struct device *, struct rtc_wkalrm *);
 	int (*proc)(struct device *, struct seq_file *);
+	int (*set_mmss64)(struct device *, time64_t secs);
 	int (*set_mmss)(struct device *, unsigned long secs);
 	int (*read_callback)(struct device *, int data);
 	int (*alarm_irq_enable)(struct device *, unsigned int enabled);
-- 
1.9.1


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

* [RFC PATCH v3 2/8] rtc/test: Update driver to address y2038/y2106 issues
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 1/8] rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 3/8] rtc/ab3100: " Xunlei Pang
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

This driver has a number of y2038/y2106 issues.

This patch resolves them by:
- Repalce get_seconds() with ktime_get_real_seconds()
- Replace rtc_time_to_tm() with rtc_time64_to_tm()

Also add test_rtc_set_mmss64() for testing rtc_class_ops's
set_mmss64(), which can be activated by "test_mmss64" module
parameter.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/rtc-test.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 8f86fa9..3a2da4c 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -13,6 +13,10 @@
 #include <linux/rtc.h>
 #include <linux/platform_device.h>
 
+static int test_mmss64;
+module_param(test_mmss64, int, 0644);
+MODULE_PARM_DESC(test_mmss64, "Test struct rtc_class_ops.set_mmss64().");
+
 static struct platform_device *test0 = NULL, *test1 = NULL;
 
 static int test_rtc_read_alarm(struct device *dev,
@@ -30,7 +34,13 @@ static int test_rtc_set_alarm(struct device *dev,
 static int test_rtc_read_time(struct device *dev,
 	struct rtc_time *tm)
 {
-	rtc_time_to_tm(get_seconds(), tm);
+	rtc_time64_to_tm(ktime_get_real_seconds(), tm);
+	return 0;
+}
+
+static int test_rtc_set_mmss64(struct device *dev, time64_t secs)
+{
+	dev_info(dev, "%s, secs = %lld\n", __func__, (long long)secs);
 	return 0;
 }
 
@@ -55,7 +65,7 @@ static int test_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)
 	return 0;
 }
 
-static const struct rtc_class_ops test_rtc_ops = {
+static struct rtc_class_ops test_rtc_ops = {
 	.proc = test_rtc_proc,
 	.read_time = test_rtc_read_time,
 	.read_alarm = test_rtc_read_alarm,
@@ -101,6 +111,11 @@ static int test_probe(struct platform_device *plat_dev)
 	int err;
 	struct rtc_device *rtc;
 
+	if (test_mmss64) {
+		test_rtc_ops.set_mmss64 = test_rtc_set_mmss64;
+		test_rtc_ops.set_mmss = NULL;
+	}
+
 	rtc = devm_rtc_device_register(&plat_dev->dev, "test",
 				&test_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
-- 
1.9.1


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

* [RFC PATCH v3 3/8] rtc/ab3100: Update driver to address y2038/y2106 issues
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 1/8] rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 2/8] rtc/test: Update driver to address y2038/y2106 issues Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-21 16:55   ` [rtc-linux] " Linus Walleij
  2015-01-20 16:21 ` [RFC PATCH v3 4/8] rtc/mc13xxx: " Xunlei Pang
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

This driver has a number of y2038/y2106 issues.

This patch resolves them by:
- Replace rtc_tm_to_time() with rtc_tm_to_time64()
- Replace rtc_time_to_tm() with rtc_time64_to_tm()
- Change ab3100_rtc_set_mmss() to use rtc_class_ops's set_mmss64()

After this patch, the driver should not have any remaining
y2038/y2106 issues.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/rtc-ab3100.c | 55 ++++++++++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/drivers/rtc/rtc-ab3100.c b/drivers/rtc/rtc-ab3100.c
index 1d0340f..9b725c5 100644
--- a/drivers/rtc/rtc-ab3100.c
+++ b/drivers/rtc/rtc-ab3100.c
@@ -43,21 +43,21 @@
 /*
  * RTC clock functions and device struct declaration
  */
-static int ab3100_rtc_set_mmss(struct device *dev, unsigned long secs)
+static int ab3100_rtc_set_mmss(struct device *dev, time64_t secs)
 {
 	u8 regs[] = {AB3100_TI0, AB3100_TI1, AB3100_TI2,
 		     AB3100_TI3, AB3100_TI4, AB3100_TI5};
 	unsigned char buf[6];
-	u64 fat_time = (u64) secs * AB3100_RTC_CLOCK_RATE * 2;
+	u64 hw_counter = secs * AB3100_RTC_CLOCK_RATE * 2;
 	int err = 0;
 	int i;
 
-	buf[0] = (fat_time) & 0xFF;
-	buf[1] = (fat_time >> 8) & 0xFF;
-	buf[2] = (fat_time >> 16) & 0xFF;
-	buf[3] = (fat_time >> 24) & 0xFF;
-	buf[4] = (fat_time >> 32) & 0xFF;
-	buf[5] = (fat_time >> 40) & 0xFF;
+	buf[0] = (hw_counter) & 0xFF;
+	buf[1] = (hw_counter >> 8) & 0xFF;
+	buf[2] = (hw_counter >> 16) & 0xFF;
+	buf[3] = (hw_counter >> 24) & 0xFF;
+	buf[4] = (hw_counter >> 32) & 0xFF;
+	buf[5] = (hw_counter >> 40) & 0xFF;
 
 	for (i = 0; i < 6; i++) {
 		err = abx500_set_register_interruptible(dev, 0,
@@ -75,7 +75,7 @@ static int ab3100_rtc_set_mmss(struct device *dev, unsigned long secs)
 
 static int ab3100_rtc_read_time(struct device *dev, struct rtc_time *tm)
 {
-	unsigned long time;
+	time64_t time;
 	u8 rtcval;
 	int err;
 
@@ -88,7 +88,7 @@ static int ab3100_rtc_read_time(struct device *dev, struct rtc_time *tm)
 		dev_info(dev, "clock not set (lost power)");
 		return -EINVAL;
 	} else {
-		u64 fat_time;
+		u64 hw_counter;
 		u8 buf[6];
 
 		/* Read out time registers */
@@ -98,22 +98,21 @@ static int ab3100_rtc_read_time(struct device *dev, struct rtc_time *tm)
 		if (err != 0)
 			return err;
 
-		fat_time = ((u64) buf[5] << 40) | ((u64) buf[4] << 32) |
+		hw_counter = ((u64) buf[5] << 40) | ((u64) buf[4] << 32) |
 			((u64) buf[3] << 24) | ((u64) buf[2] << 16) |
 			((u64) buf[1] << 8) | (u64) buf[0];
-		time = (unsigned long) (fat_time /
-					(u64) (AB3100_RTC_CLOCK_RATE * 2));
+		time = hw_counter / (u64) (AB3100_RTC_CLOCK_RATE * 2);
 	}
 
-	rtc_time_to_tm(time, tm);
+	rtc_time64_to_tm(time, tm);
 
 	return rtc_valid_tm(tm);
 }
 
 static int ab3100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 {
-	unsigned long time;
-	u64 fat_time;
+	time64_t time;
+	u64 hw_counter;
 	u8 buf[6];
 	u8 rtcval;
 	int err;
@@ -134,11 +133,11 @@ static int ab3100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 						     AB3100_AL0, buf, 4);
 	if (err)
 		return err;
-	fat_time = ((u64) buf[3] << 40) | ((u64) buf[2] << 32) |
+	hw_counter = ((u64) buf[3] << 40) | ((u64) buf[2] << 32) |
 		((u64) buf[1] << 24) | ((u64) buf[0] << 16);
-	time = (unsigned long) (fat_time / (u64) (AB3100_RTC_CLOCK_RATE * 2));
+	time = hw_counter / (u64) (AB3100_RTC_CLOCK_RATE * 2);
 
-	rtc_time_to_tm(time, &alarm->time);
+	rtc_time64_to_tm(time, &alarm->time);
 
 	return rtc_valid_tm(&alarm->time);
 }
@@ -147,17 +146,17 @@ static int ab3100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 {
 	u8 regs[] = {AB3100_AL0, AB3100_AL1, AB3100_AL2, AB3100_AL3};
 	unsigned char buf[4];
-	unsigned long secs;
-	u64 fat_time;
+	time64_t secs;
+	u64 hw_counter;
 	int err;
 	int i;
 
-	rtc_tm_to_time(&alarm->time, &secs);
-	fat_time = (u64) secs * AB3100_RTC_CLOCK_RATE * 2;
-	buf[0] = (fat_time >> 16) & 0xFF;
-	buf[1] = (fat_time >> 24) & 0xFF;
-	buf[2] = (fat_time >> 32) & 0xFF;
-	buf[3] = (fat_time >> 40) & 0xFF;
+	secs = rtc_tm_to_time64(&alarm->time);
+	hw_counter = secs * AB3100_RTC_CLOCK_RATE * 2;
+	buf[0] = (hw_counter >> 16) & 0xFF;
+	buf[1] = (hw_counter >> 24) & 0xFF;
+	buf[2] = (hw_counter >> 32) & 0xFF;
+	buf[3] = (hw_counter >> 40) & 0xFF;
 
 	/* Set the alarm */
 	for (i = 0; i < 4; i++) {
@@ -193,7 +192,7 @@ static int ab3100_rtc_irq_enable(struct device *dev, unsigned int enabled)
 
 static const struct rtc_class_ops ab3100_rtc_ops = {
 	.read_time	= ab3100_rtc_read_time,
-	.set_mmss	= ab3100_rtc_set_mmss,
+	.set_mmss64	= ab3100_rtc_set_mmss,
 	.read_alarm	= ab3100_rtc_read_alarm,
 	.set_alarm	= ab3100_rtc_set_alarm,
 	.alarm_irq_enable = ab3100_rtc_irq_enable,
-- 
1.9.1


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

* [RFC PATCH v3 4/8] rtc/mc13xxx: Update driver to address y2038/y2106 issues
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
                   ` (2 preceding siblings ...)
  2015-01-20 16:21 ` [RFC PATCH v3 3/8] rtc/ab3100: " Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 5/8] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time Xunlei Pang
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

This driver has a number of y2038/y2106 issues.

This patch resolves them by:
- Replace rtc_time_to_tm() with rtc_time64_to_tm()
- Change mc13xxx_rtc_set_mmss() to use rtc_class_ops's set_mmss64()

After this patch, the driver should not have any remaining
y2038/y2106 issues.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/rtc-mc13xxx.c | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/rtc/rtc-mc13xxx.c b/drivers/rtc/rtc-mc13xxx.c
index 5bce904b..32df1d8 100644
--- a/drivers/rtc/rtc-mc13xxx.c
+++ b/drivers/rtc/rtc-mc13xxx.c
@@ -83,20 +83,19 @@ static int mc13xxx_rtc_read_time(struct device *dev, struct rtc_time *tm)
 			return ret;
 	} while (days1 != days2);
 
-	rtc_time_to_tm(days1 * SEC_PER_DAY + seconds, tm);
+	rtc_time64_to_tm((time64_t)days1 * SEC_PER_DAY + seconds, tm);
 
 	return rtc_valid_tm(tm);
 }
 
-static int mc13xxx_rtc_set_mmss(struct device *dev, unsigned long secs)
+static int mc13xxx_rtc_set_mmss(struct device *dev, time64_t secs)
 {
 	struct mc13xxx_rtc *priv = dev_get_drvdata(dev);
 	unsigned int seconds, days;
 	unsigned int alarmseconds;
 	int ret;
 
-	seconds = secs % SEC_PER_DAY;
-	days = secs / SEC_PER_DAY;
+	days = div_s64_rem(secs, SEC_PER_DAY, &seconds);
 
 	mc13xxx_lock(priv->mc13xxx);
 
@@ -159,7 +158,7 @@ static int mc13xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 {
 	struct mc13xxx_rtc *priv = dev_get_drvdata(dev);
 	unsigned seconds, days;
-	unsigned long s1970;
+	time64_t s1970;
 	int enabled, pending;
 	int ret;
 
@@ -189,10 +188,10 @@ out:
 	alarm->enabled = enabled;
 	alarm->pending = pending;
 
-	s1970 = days * SEC_PER_DAY + seconds;
+	s1970 = (time64_t)days * SEC_PER_DAY + seconds;
 
-	rtc_time_to_tm(s1970, &alarm->time);
-	dev_dbg(dev, "%s: %lu\n", __func__, s1970);
+	rtc_time64_to_tm(s1970, &alarm->time);
+	dev_dbg(dev, "%s: %lld\n", __func__, (long long)s1970);
 
 	return 0;
 }
@@ -200,8 +199,8 @@ out:
 static int mc13xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 {
 	struct mc13xxx_rtc *priv = dev_get_drvdata(dev);
-	unsigned long s1970;
-	unsigned seconds, days;
+	time64_t s1970;
+	u32 seconds, days;
 	int ret;
 
 	mc13xxx_lock(priv->mc13xxx);
@@ -215,20 +214,17 @@ static int mc13xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 	if (unlikely(ret))
 		goto out;
 
-	ret = rtc_tm_to_time(&alarm->time, &s1970);
-	if (unlikely(ret))
-		goto out;
+	s1970 = rtc_tm_to_time64(&alarm->time);
 
-	dev_dbg(dev, "%s: o%2.s %lu\n", __func__, alarm->enabled ? "n" : "ff",
-			s1970);
+	dev_dbg(dev, "%s: o%2.s %lld\n", __func__, alarm->enabled ? "n" : "ff",
+			(long long)s1970);
 
 	ret = mc13xxx_rtc_irq_enable_unlocked(dev, alarm->enabled,
 			MC13XXX_IRQ_TODA);
 	if (unlikely(ret))
 		goto out;
 
-	seconds = s1970 % SEC_PER_DAY;
-	days = s1970 / SEC_PER_DAY;
+	days = div_s64_rem(s1970, SEC_PER_DAY, &seconds);
 
 	ret = mc13xxx_reg_write(priv->mc13xxx, MC13XXX_RTCDAYA, days);
 	if (unlikely(ret))
@@ -268,7 +264,7 @@ static irqreturn_t mc13xxx_rtc_update_handler(int irq, void *dev)
 
 static const struct rtc_class_ops mc13xxx_rtc_ops = {
 	.read_time = mc13xxx_rtc_read_time,
-	.set_mmss = mc13xxx_rtc_set_mmss,
+	.set_mmss64 = mc13xxx_rtc_set_mmss,
 	.read_alarm = mc13xxx_rtc_read_alarm,
 	.set_alarm = mc13xxx_rtc_set_alarm,
 	.alarm_irq_enable = mc13xxx_rtc_alarm_irq_enable,
-- 
1.9.1


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

* [RFC PATCH v3 5/8] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
                   ` (3 preceding siblings ...)
  2015-01-20 16:21 ` [RFC PATCH v3 4/8] rtc/mc13xxx: " Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 6/8] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t Xunlei Pang
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

rtc_class_ops's set_alarm() shouldn't deal with the alarm date,
as this is handled in the rtc core.

See rtc_dev_ioctl()'s RTC_ALM_SET and RTC_WKALM_SET cases.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/rtc-mxc.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 3c3f8d1..a7b218f 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -173,29 +173,18 @@ static void set_alarm_or_time(struct device *dev, int time_alarm, u32 time)
  * This function updates the RTC alarm registers and then clears all the
  * interrupt status bits.
  */
-static int rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
+static void rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
 {
-	struct rtc_time alarm_tm, now_tm;
-	unsigned long now, time;
+	unsigned long time;
 	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 
-	now = get_alarm_or_time(dev, MXC_RTC_TIME);
-	rtc_time_to_tm(now, &now_tm);
-	alarm_tm.tm_year = now_tm.tm_year;
-	alarm_tm.tm_mon = now_tm.tm_mon;
-	alarm_tm.tm_mday = now_tm.tm_mday;
-	alarm_tm.tm_hour = alrm->tm_hour;
-	alarm_tm.tm_min = alrm->tm_min;
-	alarm_tm.tm_sec = alrm->tm_sec;
-	rtc_tm_to_time(&alarm_tm, &time);
+	rtc_tm_to_time(alrm, &time);
 
 	/* clear all the interrupt status bits */
 	writew(readw(ioaddr + RTC_RTCISR), ioaddr + RTC_RTCISR);
 	set_alarm_or_time(dev, MXC_RTC_ALARM, time);
-
-	return 0;
 }
 
 static void mxc_rtc_irq_enable(struct device *dev, unsigned int bit,
@@ -346,11 +335,8 @@ static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
-	int ret;
 
-	ret = rtc_update_alarm(dev, &alrm->time);
-	if (ret)
-		return ret;
+	rtc_update_alarm(dev, &alrm->time);
 
 	memcpy(&pdata->g_rtc_alarm, &alrm->time, sizeof(struct rtc_time));
 	mxc_rtc_irq_enable(dev, RTC_ALM_BIT, alrm->enabled);
-- 
1.9.1


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

* [RFC PATCH v3 6/8] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
                   ` (4 preceding siblings ...)
  2015-01-20 16:21 ` [RFC PATCH v3 5/8] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 7/8] rtc/mxc: Update driver to address y2038/y2106 issues Xunlei Pang
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

We want to convert mxc_rtc_set_mmss() to use rtc_class_ops's set_mmss64(),
but it uses get_alarm_or_time()/set_alarm_or_time() internal interfaces
which are y2038 unsafe.

So here as a separate patch, it converts these two internal interfaces
of "mxc" to use safe time64_t to make some preparations.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/rtc-mxc.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index a7b218f..83cba23 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -106,7 +106,7 @@ static inline int is_imx1_rtc(struct rtc_plat_data *data)
  * This function is used to obtain the RTC time or the alarm value in
  * second.
  */
-static u32 get_alarm_or_time(struct device *dev, int time_alarm)
+static time64_t get_alarm_or_time(struct device *dev, int time_alarm)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
@@ -129,29 +129,28 @@ static u32 get_alarm_or_time(struct device *dev, int time_alarm)
 	hr = hr_min >> 8;
 	min = hr_min & 0xff;
 
-	return (((day * 24 + hr) * 60) + min) * 60 + sec;
+	return ((((time64_t)day * 24 + hr) * 60) + min) * 60 + sec;
 }
 
 /*
  * This function sets the RTC alarm value or the time value.
  */
-static void set_alarm_or_time(struct device *dev, int time_alarm, u32 time)
+static void set_alarm_or_time(struct device *dev, int time_alarm, time64_t time)
 {
-	u32 day, hr, min, sec, temp;
+	u32 tod, day, hr, min, sec, temp;
 	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 
-	day = time / 86400;
-	time -= day * 86400;
+	day = div_s64_rem(time, 86400, &tod);
 
 	/* time is within a day now */
-	hr = time / 3600;
-	time -= hr * 3600;
+	hr = tod / 3600;
+	tod -= hr * 3600;
 
 	/* time is within an hour now */
-	min = time / 60;
-	sec = time - min * 60;
+	min = tod / 60;
+	sec = tod - min * 60;
 
 	temp = (hr << 8) + min;
 
@@ -175,12 +174,12 @@ static void set_alarm_or_time(struct device *dev, int time_alarm, u32 time)
  */
 static void rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
 {
-	unsigned long time;
+	time64_t time;
 	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 
-	rtc_tm_to_time(alrm, &time);
+	time = rtc_tm_to_time64(alrm);
 
 	/* clear all the interrupt status bits */
 	writew(readw(ioaddr + RTC_RTCISR), ioaddr + RTC_RTCISR);
@@ -272,14 +271,14 @@ static int mxc_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
  */
 static int mxc_rtc_read_time(struct device *dev, struct rtc_time *tm)
 {
-	u32 val;
+	time64_t val;
 
 	/* Avoid roll-over from reading the different registers */
 	do {
 		val = get_alarm_or_time(dev, MXC_RTC_TIME);
 	} while (val != get_alarm_or_time(dev, MXC_RTC_TIME));
 
-	rtc_time_to_tm(val, tm);
+	rtc_time64_to_tm(val, tm);
 
 	return 0;
 }
@@ -322,7 +321,7 @@ static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 
-	rtc_time_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time);
+	rtc_time64_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time);
 	alrm->pending = ((readw(ioaddr + RTC_RTCISR) & RTC_ALM_BIT)) ? 1 : 0;
 
 	return 0;
-- 
1.9.1


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

* [RFC PATCH v3 7/8] rtc/mxc: Update driver to address y2038/y2106 issues
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
                   ` (5 preceding siblings ...)
  2015-01-20 16:21 ` [RFC PATCH v3 6/8] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-20 16:21 ` [RFC PATCH v3 8/8] alpha: rtc: change to use rtc_class_ops's set_mmss64() Xunlei Pang
  2015-01-28 16:12 ` [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
  8 siblings, 0 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

This driver has a number of y2038/y2106 issues.

This patch resolves them by:
- Replace rtc_time_to_tm() with rtc_time64_to_tm()
- Replace rtc_tm_to_time() with rtc_tm_to_time64()
- Change mxc_rtc_set_mmss() to use rtc_class_ops's set_mmss64()

After this patch, the driver should not have any remaining
y2038/y2106 issues.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/rtc-mxc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 83cba23..09d422b 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -286,7 +286,7 @@ static int mxc_rtc_read_time(struct device *dev, struct rtc_time *tm)
 /*
  * This function sets the internal RTC time based on tm in Gregorian date.
  */
-static int mxc_rtc_set_mmss(struct device *dev, unsigned long time)
+static int mxc_rtc_set_mmss(struct device *dev, time64_t time)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
@@ -297,9 +297,9 @@ static int mxc_rtc_set_mmss(struct device *dev, unsigned long time)
 	if (is_imx1_rtc(pdata)) {
 		struct rtc_time tm;
 
-		rtc_time_to_tm(time, &tm);
+		rtc_time64_to_tm(time, &tm);
 		tm.tm_year = 70;
-		rtc_tm_to_time(&tm, &time);
+		time = rtc_tm_to_time64(&tm);
 	}
 
 	/* Avoid roll-over from reading the different registers */
@@ -347,7 +347,7 @@ static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 static struct rtc_class_ops mxc_rtc_ops = {
 	.release		= mxc_rtc_release,
 	.read_time		= mxc_rtc_read_time,
-	.set_mmss		= mxc_rtc_set_mmss,
+	.set_mmss64		= mxc_rtc_set_mmss,
 	.read_alarm		= mxc_rtc_read_alarm,
 	.set_alarm		= mxc_rtc_set_alarm,
 	.alarm_irq_enable	= mxc_rtc_alarm_irq_enable,
-- 
1.9.1


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

* [RFC PATCH v3 8/8] alpha: rtc: change to use rtc_class_ops's set_mmss64()
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
                   ` (6 preceding siblings ...)
  2015-01-20 16:21 ` [RFC PATCH v3 7/8] rtc/mxc: Update driver to address y2038/y2106 issues Xunlei Pang
@ 2015-01-20 16:21 ` Xunlei Pang
  2015-01-28 16:12 ` [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
  8 siblings, 0 replies; 17+ messages in thread
From: Xunlei Pang @ 2015-01-20 16:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

change alpha_rtc_set_mmss() and remote_set_mmss() to use
rtc_class_ops's set_mmss64().

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 arch/alpha/kernel/rtc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/alpha/kernel/rtc.c b/arch/alpha/kernel/rtc.c
index c8d284d..f535a3f 100644
--- a/arch/alpha/kernel/rtc.c
+++ b/arch/alpha/kernel/rtc.c
@@ -116,7 +116,7 @@ alpha_rtc_set_time(struct device *dev, struct rtc_time *tm)
 }
 
 static int
-alpha_rtc_set_mmss(struct device *dev, unsigned long nowtime)
+alpha_rtc_set_mmss(struct device *dev, time64_t nowtime)
 {
 	int retval = 0;
 	int real_seconds, real_minutes, cmos_minutes;
@@ -211,7 +211,7 @@ alpha_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
 static const struct rtc_class_ops alpha_rtc_ops = {
 	.read_time = alpha_rtc_read_time,
 	.set_time = alpha_rtc_set_time,
-	.set_mmss = alpha_rtc_set_mmss,
+	.set_mmss64 = alpha_rtc_set_mmss,
 	.ioctl = alpha_rtc_ioctl,
 };
 
@@ -276,7 +276,7 @@ do_remote_mmss(void *data)
 }
 
 static int
-remote_set_mmss(struct device *dev, unsigned long now)
+remote_set_mmss(struct device *dev, time64_t now)
 {
 	union remote_data x;
 	if (smp_processor_id() != boot_cpuid) {
@@ -290,7 +290,7 @@ remote_set_mmss(struct device *dev, unsigned long now)
 static const struct rtc_class_ops remote_rtc_ops = {
 	.read_time = remote_read_time,
 	.set_time = remote_set_time,
-	.set_mmss = remote_set_mmss,
+	.set_mmss64 = remote_set_mmss,
 	.ioctl = alpha_rtc_ioctl,
 };
 #endif
-- 
1.9.1


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

* Re: [rtc-linux] [RFC PATCH v3 3/8] rtc/ab3100: Update driver to address y2038/y2106 issues
  2015-01-20 16:21 ` [RFC PATCH v3 3/8] rtc/ab3100: " Xunlei Pang
@ 2015-01-21 16:55   ` Linus Walleij
  0 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2015-01-21 16:55 UTC (permalink / raw)
  To: rtc-linux
  Cc: linux-kernel, Thomas Gleixner, Alessandro Zummo,
	Richard Henderson, Uwe Kleine-Koenig, Linus Walleij,
	Fabio Estevam, John Stultz, Arnd Bergmann, Xunlei Pang

On Tue, Jan 20, 2015 at 5:21 PM, Xunlei Pang <pang.xunlei@linaro.org> wrote:

> This driver has a number of y2038/y2106 issues.
>
> This patch resolves them by:
> - Replace rtc_tm_to_time() with rtc_tm_to_time64()
> - Replace rtc_time_to_tm() with rtc_time64_to_tm()
> - Change ab3100_rtc_set_mmss() to use rtc_class_ops's set_mmss64()
>
> After this patch, the driver should not have any remaining
> y2038/y2106 issues.
>
> Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
  2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
                   ` (7 preceding siblings ...)
  2015-01-20 16:21 ` [RFC PATCH v3 8/8] alpha: rtc: change to use rtc_class_ops's set_mmss64() Xunlei Pang
@ 2015-01-28 16:12 ` Xunlei Pang
  2015-01-28 18:27   ` Alessandro Zummo
  8 siblings, 1 reply; 17+ messages in thread
From: Xunlei Pang @ 2015-01-28 16:12 UTC (permalink / raw)
  To: lkml
  Cc: rtc-linux, Thomas Gleixner, Alessandro Zummo, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann, Xunlei Pang

ping Alessandro

On 21 January 2015 at 00:21, Xunlei Pang <pang.xunlei@linaro.org> wrote:
> This patch series relies on a former patchset[1], it provides y2038/y2106
> safe rtc_class_ops.set_mmss64(), and converts some possible users of set_mmss()
> to use set_mmss64(), in the hope that making these users(i.e. rtc drivers)
> y2038/y2106 safe.
>
> [1] https://lkml.org/lkml/2014/11/18/218
> [2] v1: https://lkml.org/lkml/2014/11/27/341
> [3] v2: https://lkml.org/lkml/2015/1/13/403
>
> v2->v3:
> * Remove get_seconds64(), use ktime_get_real_seconds() to replace get_seconds()
> * Refine rtc-test.c
>
> Xunlei Pang (8):
>   rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement
>   rtc/test: Update driver to address y2038/y2106 issues
>   rtc/ab3100: Update driver to address y2038/y2106 issues
>   rtc/mc13xxx: Update driver to address y2038/y2106 issues
>   rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time
>   rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use
>     time64_t
>   rtc/mxc: Update driver to address y2038/y2106 issues
>   alpha: rtc: change to use rtc_class_ops's set_mmss64()
>
>  arch/alpha/kernel/rtc.c   |  8 +++----
>  drivers/rtc/interface.c   |  7 +++++-
>  drivers/rtc/rtc-ab3100.c  | 55 +++++++++++++++++++++++------------------------
>  drivers/rtc/rtc-mc13xxx.c | 32 ++++++++++++---------------
>  drivers/rtc/rtc-mxc.c     | 55 +++++++++++++++++------------------------------
>  drivers/rtc/rtc-test.c    | 19 ++++++++++++++--
>  drivers/rtc/systohc.c     |  5 ++++-
>  include/linux/rtc.h       |  1 +
>  8 files changed, 93 insertions(+), 89 deletions(-)
>
> --
> 1.9.1
>

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

* Re: [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
  2015-01-28 16:12 ` [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
@ 2015-01-28 18:27   ` Alessandro Zummo
  2015-01-28 18:53     ` John Stultz
  2015-03-18 17:37     ` John Stultz
  0 siblings, 2 replies; 17+ messages in thread
From: Alessandro Zummo @ 2015-01-28 18:27 UTC (permalink / raw)
  To: Xunlei Pang
  Cc: lkml, rtc-linux, Thomas Gleixner, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, John Stultz,
	Arnd Bergmann

On Thu, 29 Jan 2015 00:12:09 +0800
Xunlei Pang <pang.xunlei@linaro.org> wrote:

> ping Alessandro

  -EBUSY . saw that, looks fine anyhow, but would like to
 have a deeper look. we have still some time 'till 2038, right? ;)

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


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

* Re: [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
  2015-01-28 18:27   ` Alessandro Zummo
@ 2015-01-28 18:53     ` John Stultz
  2015-03-18 17:37     ` John Stultz
  1 sibling, 0 replies; 17+ messages in thread
From: John Stultz @ 2015-01-28 18:53 UTC (permalink / raw)
  To: Alessandro Zummo
  Cc: Xunlei Pang, lkml, rtc-linux, Thomas Gleixner, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, Arnd Bergmann

On Wed, Jan 28, 2015 at 10:27 AM, Alessandro Zummo <a.zummo@towertech.it> wrote:
> On Thu, 29 Jan 2015 00:12:09 +0800
> Xunlei Pang <pang.xunlei@linaro.org> wrote:
>
>> ping Alessandro
>
>   -EBUSY . saw that, looks fine anyhow, but would like to
>  have a deeper look. we have still some time 'till 2038, right? ;)

While that is true, for folks who are working to deploy systems that
may have 23+ year life times, getting this resolved in the near term
is important.  With so many changes all over the kernel (and then
userspace) pushing back on this "plenty of time" sentiment is
important for this to ever get done.

So yea, if you can't look at it right this second, that's fine, but
please don't put it at the bottom of your todo list for the year. :)

thanks
-john

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

* Re: [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
  2015-01-28 18:27   ` Alessandro Zummo
  2015-01-28 18:53     ` John Stultz
@ 2015-03-18 17:37     ` John Stultz
  2015-03-18 23:53       ` Alessandro Zummo
  2015-03-19 23:29       ` Alessandro Zummo
  1 sibling, 2 replies; 17+ messages in thread
From: John Stultz @ 2015-03-18 17:37 UTC (permalink / raw)
  To: Alessandro Zummo
  Cc: Xunlei Pang, lkml, rtc-linux, Thomas Gleixner, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, Arnd Bergmann

On Wed, Jan 28, 2015 at 10:27 AM, Alessandro Zummo <a.zummo@towertech.it> wrote:
> On Thu, 29 Jan 2015 00:12:09 +0800
> Xunlei Pang <pang.xunlei@linaro.org> wrote:
>
>> ping Alessandro
>
>   -EBUSY . saw that, looks fine anyhow, but would like to
>  have a deeper look. we have still some time 'till 2038, right? ;)

Hey Alessandro,
  I was hoping to let these go through you (with your review), but if
you're still too busy I can queue them if you'd rather.

thanks
-john

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

* Re: [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
  2015-03-18 17:37     ` John Stultz
@ 2015-03-18 23:53       ` Alessandro Zummo
  2015-03-19 23:29       ` Alessandro Zummo
  1 sibling, 0 replies; 17+ messages in thread
From: Alessandro Zummo @ 2015-03-18 23:53 UTC (permalink / raw)
  To: John Stultz
  Cc: Xunlei Pang, lkml, rtc-linux, Thomas Gleixner, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, Arnd Bergmann

On Wed, 18 Mar 2015 10:37:26 -0700
John Stultz <john.stultz@linaro.org> wrote:

> Hey Alessandro,
>   I was hoping to let these go through you (with your review), but if
> you're still too busy I can queue them if you'd rather.

 Hello,

   will review today and let you know.

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


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

* Re: [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
  2015-03-18 17:37     ` John Stultz
  2015-03-18 23:53       ` Alessandro Zummo
@ 2015-03-19 23:29       ` Alessandro Zummo
  2015-03-24 21:42         ` John Stultz
  1 sibling, 1 reply; 17+ messages in thread
From: Alessandro Zummo @ 2015-03-19 23:29 UTC (permalink / raw)
  To: John Stultz
  Cc: Xunlei Pang, lkml, rtc-linux, Thomas Gleixner, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, Arnd Bergmann,
	akpm

On Wed, 18 Mar 2015 10:37:26 -0700
John Stultz <john.stultz@linaro.org> wrote:

> On Wed, Jan 28, 2015 at 10:27 AM, Alessandro Zummo <a.zummo@towertech.it> wrote:
> > On Thu, 29 Jan 2015 00:12:09 +0800
> > Xunlei Pang <pang.xunlei@linaro.org> wrote:
> >
> >> ping Alessandro
> >
> >   -EBUSY . saw that, looks fine anyhow, but would like to
> >  have a deeper look. we have still some time 'till 2038, right? ;)
> 
> Hey Alessandro,
>   I was hoping to let these go through you (with your review), but if
> you're still too busy I can queue them if you'd rather.

 Looks fine to me. The only thing that I would change
 is the naming of the drivername_rtc_set_mmss in the drivers:
 it should end with mmss64 when it's changed.

 But that's probably just me being pedantic.

 Acked-by: Alessandro Zummo <a.zummo@towertech.it>

 Can you please queue them?

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


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

* Re: [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()
  2015-03-19 23:29       ` Alessandro Zummo
@ 2015-03-24 21:42         ` John Stultz
  0 siblings, 0 replies; 17+ messages in thread
From: John Stultz @ 2015-03-24 21:42 UTC (permalink / raw)
  To: Alessandro Zummo
  Cc: Xunlei Pang, lkml, rtc-linux, Thomas Gleixner, Richard Henderson,
	Uwe Kleine-Koenig, Linus Walleij, Fabio Estevam, Arnd Bergmann,
	Andrew Morton

On Thu, Mar 19, 2015 at 4:29 PM, Alessandro Zummo <a.zummo@towertech.it> wrote:
> On Wed, 18 Mar 2015 10:37:26 -0700
> John Stultz <john.stultz@linaro.org> wrote:
>
>> On Wed, Jan 28, 2015 at 10:27 AM, Alessandro Zummo <a.zummo@towertech.it> wrote:
>> > On Thu, 29 Jan 2015 00:12:09 +0800
>> > Xunlei Pang <pang.xunlei@linaro.org> wrote:
>> >
>> >> ping Alessandro
>> >
>> >   -EBUSY . saw that, looks fine anyhow, but would like to
>> >  have a deeper look. we have still some time 'till 2038, right? ;)
>>
>> Hey Alessandro,
>>   I was hoping to let these go through you (with your review), but if
>> you're still too busy I can queue them if you'd rather.
>
>  Looks fine to me. The only thing that I would change
>  is the naming of the drivername_rtc_set_mmss in the drivers:
>  it should end with mmss64 when it's changed.
>
>  But that's probably just me being pedantic.
>
>  Acked-by: Alessandro Zummo <a.zummo@towertech.it>
>
>  Can you please queue them?

Thanks for the review! I've queued them in my tree for 4.1

thanks
-john

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

end of thread, other threads:[~2015-03-24 21:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20 16:21 [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
2015-01-20 16:21 ` [RFC PATCH v3 1/8] rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement Xunlei Pang
2015-01-20 16:21 ` [RFC PATCH v3 2/8] rtc/test: Update driver to address y2038/y2106 issues Xunlei Pang
2015-01-20 16:21 ` [RFC PATCH v3 3/8] rtc/ab3100: " Xunlei Pang
2015-01-21 16:55   ` [rtc-linux] " Linus Walleij
2015-01-20 16:21 ` [RFC PATCH v3 4/8] rtc/mc13xxx: " Xunlei Pang
2015-01-20 16:21 ` [RFC PATCH v3 5/8] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time Xunlei Pang
2015-01-20 16:21 ` [RFC PATCH v3 6/8] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t Xunlei Pang
2015-01-20 16:21 ` [RFC PATCH v3 7/8] rtc/mxc: Update driver to address y2038/y2106 issues Xunlei Pang
2015-01-20 16:21 ` [RFC PATCH v3 8/8] alpha: rtc: change to use rtc_class_ops's set_mmss64() Xunlei Pang
2015-01-28 16:12 ` [RFC PATCH v3 0/8] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
2015-01-28 18:27   ` Alessandro Zummo
2015-01-28 18:53     ` John Stultz
2015-03-18 17:37     ` John Stultz
2015-03-18 23:53       ` Alessandro Zummo
2015-03-19 23:29       ` Alessandro Zummo
2015-03-24 21:42         ` John Stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).