Re: [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-30 Thread Alessandro Zummo
On Sat, 29 Nov 2014 00:20:00 +0800 "pang.xunlei" wrote: > Anyway, they are ungraceful being there. I'll refine this patchset carefully > according to your valuable suggestions, and will send out another version. > > Thanks for your review! I have quite the feeling those patches will cause

Re: [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-30 Thread Alessandro Zummo
On Sat, 29 Nov 2014 00:20:00 +0800 pang.xunlei pang.xun...@linaro.org wrote: Anyway, they are ungraceful being there. I'll refine this patchset carefully according to your valuable suggestions, and will send out another version. Thanks for your review! I have quite the feeling those

Re: [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-28 Thread pang.xunlei
On 28 November 2014 at 07:24, Thomas Gleixner wrote: > On Thu, 27 Nov 2014, Xunlei Pang wrote: >> @@ -213,17 +213,16 @@ static int dryice_rtc_set_mmss(struct device *dev, >> time64_t secs) >> { >> struct imxdi_dev *imxdi = dev_get_drvdata(dev); >> int rc; >> + u32 hwtime; >> +

Re: [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-28 Thread pang.xunlei
On 28 November 2014 at 07:24, Thomas Gleixner t...@linutronix.de wrote: On Thu, 27 Nov 2014, Xunlei Pang wrote: @@ -213,17 +213,16 @@ static int dryice_rtc_set_mmss(struct device *dev, time64_t secs) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); int rc; + u32 hwtime;

Re: [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-27 Thread Thomas Gleixner
On Thu, 27 Nov 2014, Xunlei Pang wrote: > @@ -213,17 +213,16 @@ static int dryice_rtc_set_mmss(struct device *dev, > time64_t secs) > { > struct imxdi_dev *imxdi = dev_get_drvdata(dev); > int rc; > + u32 hwtime; > + > + rc = rtc_time64_to_hw32(secs, ); > + if (rc < 0) > +

[RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-27 Thread Xunlei Pang
The rtc/imxdi rtc driver has a number of y2038/y2106 issues, the worst one is its hardware only supports 32-bit time. This patch resolves them based on our foregoing efforts: - Replace rtc_time_to_tm() with rtc_hw32_to_time64()/rtc_time64_to_tm() - Replace rtc_tm_to_time() with

[RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-27 Thread Xunlei Pang
The rtc/imxdi rtc driver has a number of y2038/y2106 issues, the worst one is its hardware only supports 32-bit time. This patch resolves them based on our foregoing efforts: - Replace rtc_time_to_tm() with rtc_hw32_to_time64()/rtc_time64_to_tm() - Replace rtc_tm_to_time() with

Re: [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-27 Thread Thomas Gleixner
On Thu, 27 Nov 2014, Xunlei Pang wrote: @@ -213,17 +213,16 @@ static int dryice_rtc_set_mmss(struct device *dev, time64_t secs) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); int rc; + u32 hwtime; + + rc = rtc_time64_to_hw32(secs, hwtime); + if (rc 0) +