Skip to content
Commit f3ec434c authored by Konstantin Shlyakhovoy's avatar Konstantin Shlyakhovoy Committed by Linus Torvalds
Browse files

drivers/rtc/rtc-twl.c: use static register while reading time



RTC stores time and date in several registers.  Due to the fact that
these registers can't be read instantaneously, there is a chance that
reading from counting registers gives an error of one minute, one hour,
one day, etc.

To address this issue, the RTC has hardware support to copy the RTC
counting registers to static shadowed registers.  The current
implementation does not use this feature, and in a stress test, we can
reproduce this error at a rate of around two times per 300000 readings.

Fix the implementation to ensure that the right snapshot of time is
captured.

Signed-off-by: default avatarKonstantin Shlyakhovoy <x0155534@ti.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: linux-omap <linux-omap@vger.kernel.org>
Acked-by: default avatarMykola Oleksiienko <x0174904@ti.com>
Acked-by: default avatarOleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Acked-by: default avatarGraeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c3cba928
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment