Thomas Gleixner b0ecd8e8c5 rtc: cmos: Make rtc_cmos sync offset correct
The offset for rtc_cmos must be -500ms to work correctly with the current
implementation of rtc_set_ntp_time() due to the following:

  tsched       twrite(t2.tv_sec - 1) 	 t2 (seconds increment)

twrite - tsched is the transport time for the write to hit the device,
which is negligible for this chip because it's accessed directly.

t2 - twrite = 500ms according to the datasheet.

But rtc_set_ntp_time() calculation of tsched is:

    tsched = t2 - 1sec - (t2 - twrite)

The default for the sync offset is 500ms which means that the write happens
at t2 - 1.5 seconds which is obviously off by a second for this device.

Make the offset -500ms so it works correct.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201206220541.830517160@linutronix.de
2020-12-11 10:40:52 +01:00
..
2020-07-02 22:32:00 +02:00
2020-07-21 09:56:46 +02:00
2019-11-08 16:14:09 +01:00
2019-07-17 10:03:50 -07:00
2020-07-02 22:32:01 +02:00
2019-11-08 16:14:09 +01:00
2019-12-23 11:23:53 +01:00
2019-04-04 10:07:10 +02:00
2020-10-19 22:48:55 +02:00
2019-10-19 22:33:05 +02:00
2019-11-08 16:14:09 +01:00
2020-09-15 11:21:50 +02:00
2019-05-23 17:44:52 +02:00
2020-03-16 11:12:08 +01:00
2019-05-08 22:14:36 +02:00