[rtc-linux] Re: [PATCH 3/3] rtc: armada38x: Prepare for being use on 64 bits

2016-12-08 Thread Russell King - ARM Linux
On Thu, Dec 08, 2016 at 06:10:10PM +0100, Gregory CLEMENT wrote: > The drivers are supposed to be portable, however there are few assumption > done here about the unsigned long size. Make sure we use the accurate > width for the variable. > > Signed-off-by: Gregory CLEMENT > --- > drivers/rtc/rt

[rtc-linux] Re: [PATCH 2/3] rtc: armada38x: Convert to time64_t

2016-12-08 Thread Russell King - ARM Linux
On Thu, Dec 08, 2016 at 06:10:09PM +0100, Gregory CLEMENT wrote: > It is one more step to remove the deprecated functions rtc_time_to_tm > and rtc_tm_to_time. I fail to see any advantage to this patch, or in fact the y2038 patch merged into rtc. Let's first look at the original rtc_time_to_tm():

[rtc-linux] Re: [PATCH 1/3] rtc: armada38x: improve RTC errata implementation

2016-12-08 Thread Russell King - ARM Linux
On Thu, Dec 08, 2016 at 06:10:08PM +0100, Gregory CLEMENT wrote: > From: Shaker Daibes > > According to FE-3124064: > The device supports CPU write and read access to the RTC time register. > However, due to this errata, read from RTC TIME register may fail. > > Workaround: > General configurati

[rtc-linux] Re: [PATCH 1/3] rtc: armada38x: improve RTC errata implementation

2016-12-08 Thread Andrew Lunn
> +struct str_value_to_freq { > + unsigned long value; > + u8 freq; > +} __packed; > + > +static unsigned long read_rtc_register_wa(struct armada38x_rtc *rtc, u8 > rtc_reg) > +{ > + unsigned long value_array[SAMPLE_NR], i, j, value; > + unsigned long max = 0, index_max = SAMPLE_NR

[rtc-linux] [PATCH 1/3] rtc: armada38x: improve RTC errata implementation

2016-12-08 Thread Gregory CLEMENT
From: Shaker Daibes According to FE-3124064: The device supports CPU write and read access to the RTC time register. However, due to this errata, read from RTC TIME register may fail. Workaround: General configuration: 1. Configure the RTC Mbus Bridge Timing Control register (offset 0x184A0)

[rtc-linux] [PATCH 2/3] rtc: armada38x: Convert to time64_t

2016-12-08 Thread Gregory CLEMENT
It is one more step to remove the deprecated functions rtc_time_to_tm and rtc_tm_to_time. And as bonus it simplifies a little the driver. Signed-off-by: Gregory CLEMENT --- drivers/rtc/rtc-armada38x.c | 42 ++ 1 file changed, 18 insertions(+), 24 deletion

[rtc-linux] [PATCH 0/3] rtc: armada38x: Few improvement and cleanup

2016-12-08 Thread Gregory CLEMENT
Hi, this series brings some improvement and cleanup for the armada 38x RTC. The errata for this RTC gave us more information on how to work around it. The first patch implement it. The second patch convert the driver to the time64_t usage. And the last patch make the driver really usable on 64

[rtc-linux] [PATCH 3/3] rtc: armada38x: Prepare for being use on 64 bits

2016-12-08 Thread Gregory CLEMENT
The drivers are supposed to be portable, however there are few assumption done here about the unsigned long size. Make sure we use the accurate width for the variable. Signed-off-by: Gregory CLEMENT --- drivers/rtc/rtc-armada38x.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) di

[rtc-linux] RTC used as a module

2016-12-08 Thread Michal Simek
Hi guys, I am trying to find out reason for this behavior. If rtc-zynqmp is used as module for the first time it is correctly probed based on aliases setting. (rtc5 for log below). But then driver is removed and add again rtc5 is still not freed. rtc_device_release() is not called that's why rtc->