Skip to content

rtc: rv3028: Work around consecutive read issue while polling

This is a workaround for what we suspect is an undocumented silicon erratum in the RV-3028 RTC. It adds an artificial sleep whenever something reads the current time from the RTC's registers.

Whenever there is an open I2C transaction, the RV-3028 will hold its time registers steady, in order to avoid a torn read/write hazard. If the time registers would have ticked to a new value during that transaction, the RV-3028 is supposed to postpone that update and apply it as soon as the transaction ends.

But on some boards, we're seeing the time registers never update at all whenever they're under rapid polling. hwclock does rapid polling under normal usage, so this causes it to error with "Timed out waiting for time change".

We theorize that problematic RV-3028 chips need a big block of idle bus time in order to apply postponed time updates.

We sleep for 2-4 milliseconds. Shorter sleeps might also work; we just haven't tested with them.

This patch was adapted from: https://github.com/Opentrons/buildroot/blob/v1.11.0/board/opentrons/ot2/kernel-patches/0008-Work-around-rv3028-problems-via-artificial-delay.patch

Signed-off-by: Frieder Schrempf frieder.schrempf@kontron.de

Merge request reports