Time has changed during boot

Hello,

Today I turned on my colibri imx6dl system. My debug console is spamming the following during the boot process.

[   20.690604] systemd[1]: Time has been changed
[   20.695824] systemd[1]: Time has been changed
[   20.701013] systemd[1]: Time has been changed
[   20.706212] systemd[1]: Time has been changed
[   20.711405] systemd[1]: Time has been changed
[   20.716633] systemd[1]: Time has been changed

What is causing this? Yesterday everything was working fine before I’ve turned off the system. I didn’t change anything in between. How can I get this module working again without reflashing it?

What is causing this?

We have seen this issue caused by a “partial RTC failure” which leads to a time read out which is valid, but far in the future (beyond 2038). Can you check your kernel boot log what time the system recovers from the RTC?

How can I get this module working again without reflashing it?

If the above is the issue, then disconnecting power and any RTC battery for a minute or so should clear the RTC and read back an invalid time, so that the BSP will automatically fall back to a sensible time (compile time).

Looks like didn’t wait long enough yesterday disconnecting the powersupply. Now it’s working again. So I can’t check the time anymore.

But how can I prevent this? Actually a few weeks ago I had the same issue. At that time I thought I made a mistake somehow in the BSP. But this time I didn’t change anything. This is a major issue if this can happen so easily.

I think it really depends on the RTC, some seem to flip easily in a problematic way. We had in our temperature chamber out of several dozen one problematic RTC too, that is where we noticed it. I guess the RTC on your carrier board happens to be a more problematic one too.

Anyway, I agree that should not happen, and there is actually an issue number already: 22975. I had some preliminary patches already, I cleaned them up and pushed it to our -next branch:

http://git.toradex.com/cgit/linux-toradex.git/log/?h=toradex_4.1-2.0.x-imx-next

With the two patches “rtc: ds1307: support m41t0 variant” and “ARM: dts: imx: fix M41T0 RTC compatible string” the RTC driver won’t trust the RTC if the oscillator failed, and should therefor not come up with such a date value anymore.

See also similar question for VF61 here:
https://www.toradex.com/community/questions/13313/time-has-changed-during-boot-on-colibri-vf61.html

Hi: We are using h=toradex_4.1-2.0.x-imx#ba2f75f559bc54406e8938ab5be722298fe7166c which should have both of those patches but still sometimes see this exact issue. Currently we are discharging the RTC battery using an LED manually.

Hi: We are using h=toradex_4.1-2.0.x-imx#ba2f75f559bc54406e8938ab5be722298fe7166c

This is not the proper way of giving a git hash reference. But I agree you are at 2.7b2 which should already have that issue resolved. However we do not know anything else about your environment and such (e.g. carrier board, exact versions of things and so forth).

which should have both of those patches but still sometimes see this exact issue. Currently we are discharging the RTC battery using an LED manually.

For above mentioned reasons may I suggest to open a new question answering any and all of the environment/versions and so forth question so we may figure out what it is that may go wrong in your case.