SolidRun / linux-fslc

Linux kernel source tree
Other
12 stars 26 forks source link

RTC battery backup not used #67

Open kevinmoll14 opened 4 years ago

kevinmoll14 commented 4 years ago

@jnettlet: Commit df7f7ef8cbfa7c518c40bbd2f91a6670b85779c7 introduces a bug where the battery backup for the RTC is disabled.

On first-ever powerup of the PCF, the chip returns a random time and battery backup is not enabled. The kernel driver enables the battery backup. However, if the random time is outside the checked range introduced by this commit, the kernel driver does a software reset of the PCF. This causes the battery backup to be disabled again.

This is a problem because every time the user removes power from the device, on next boot a random time will be returned and battery backup disabled. This keeps happening until the random time just happens to fall within the valid range of times you've constrained the clock to have.

The software reset should be performed before the battery backup is enabled.