Re: [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-12-01 Thread Thomas Gleixner
On Sat, 29 Nov 2014, pang.xunlei wrote: > On 28 November 2014 at 07:16, Thomas Gleixner wrote: > > How is that going to be useful w/o a mechanism to adjust the epoch > > offset at runtime by any means? > > If the rtc epoch changes at runtime, we'll not get the right time once > the system is

Re: [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-12-01 Thread Thomas Gleixner
On Sat, 29 Nov 2014, pang.xunlei wrote: On 28 November 2014 at 07:16, Thomas Gleixner t...@linutronix.de wrote: How is that going to be useful w/o a mechanism to adjust the epoch offset at runtime by any means? If the rtc epoch changes at runtime, we'll not get the right time once the

Re: [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-11-28 Thread pang.xunlei
On 28 November 2014 at 07:16, Thomas Gleixner wrote: > On Thu, 27 Nov 2014, Xunlei Pang wrote: >> +/* Rtc epoch year, can be overrided by command line */ >> +static unsigned int rtc_epoch = 1970; >> +time64_t rtc_epoch_secs_since_1970; >> + >> +static int __init >> +set_rtc_epoch(char *str) > >

Re: [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-11-28 Thread pang.xunlei
On 28 November 2014 at 07:16, Thomas Gleixner t...@linutronix.de wrote: On Thu, 27 Nov 2014, Xunlei Pang wrote: +/* Rtc epoch year, can be overrided by command line */ +static unsigned int rtc_epoch = 1970; +time64_t rtc_epoch_secs_since_1970; + +static int __init +set_rtc_epoch(char *str)

Re: [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-11-27 Thread Thomas Gleixner
On Thu, 27 Nov 2014, Xunlei Pang wrote: > +/* Rtc epoch year, can be overrided by command line */ > +static unsigned int rtc_epoch = 1970; > +time64_t rtc_epoch_secs_since_1970; > + > +static int __init > +set_rtc_epoch(char *str) One line please > +{ > + unsigned int epoch; > + > + if

[RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-11-27 Thread Xunlei Pang
To attack the 32bit rtc hardware limitations which will bring about y2106 issues to their rtc drivers as those marked "y2106 issue" tags in the former patch, this patch adds a common rtc epoch offset, and provides two interfaces to map between 32bit rtc hardware and 64bit time using this rtc epoch

[RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-11-27 Thread Xunlei Pang
To attack the 32bit rtc hardware limitations which will bring about y2106 issues to their rtc drivers as those marked y2106 issue tags in the former patch, this patch adds a common rtc epoch offset, and provides two interfaces to map between 32bit rtc hardware and 64bit time using this rtc epoch

Re: [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-11-27 Thread Thomas Gleixner
On Thu, 27 Nov 2014, Xunlei Pang wrote: +/* Rtc epoch year, can be overrided by command line */ +static unsigned int rtc_epoch = 1970; +time64_t rtc_epoch_secs_since_1970; + +static int __init +set_rtc_epoch(char *str) One line please +{ + unsigned int epoch; + + if