diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-11-23 10:55:27 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-02-09 23:01:49 +0100 |
commit | e5c594233fcf1a55a439dec103aa815cdbf392a7 (patch) | |
tree | 7050bb9d95aafa01a1bc374fa12efcacab588237 /Documentation | |
parent | include/linux/bcd.h: provide bcd_is_valid() helper (diff) | |
download | linux-e5c594233fcf1a55a439dec103aa815cdbf392a7.tar.xz linux-e5c594233fcf1a55a439dec103aa815cdbf392a7.zip |
rtc: rv8803: invalidate date/time if alarm time is invalid
RTC core never calls rv8803_set_alarm with an invalid alarm time,
so if an invalid alarm time > 0 is set, external factors must have
corrupted the RTC's alarm time and possibly other registers.
Play it safe by marking the date/time invalid, so all registers are
reinitialized on a ->set_time.
This may cause existing setups to lose time if they so far set only
date/time, but ignored that the alarm registers had an invalid date
value, e.g.:
rtc rtc0: invalid alarm value: 2020-3-27 7:82:0
These systems will have their ->get_time return -EINVAL till
->set_time initializes the alarm value (and sets a new time).
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20221123095527.2771434-3-s.hauer@pengutronix.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions