diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-01-26 20:02:11 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2021-01-27 11:36:22 +0300 |
commit | 211e5db19d15a721b2953ea54b8f26c2963720eb (patch) | |
tree | b8347d98437f5ac8527f9c36e1620635c50a5501 /mm/page_alloc.c | |
parent | 13391c60da3308ed9980de0168f74cce6c62ac1d (diff) | |
download | linux-211e5db19d15a721b2953ea54b8f26c2963720eb.tar.xz |
rtc: mc146818: Detect and handle broken RTCs
The recent fix for handling the UIP bit unearthed another issue in the RTC
code. If the RTC is advertised but the readout is straight 0xFF because
it's not available, the old code just proceeded with crappy values, but the
new code hangs because it waits for the UIP bit to become low.
Add a sanity check in the RTC CMOS probe function which reads the RTC_VALID
register (Register D) which should have bit 0-6 cleared. If that's not the
case then fail to register the CMOS.
Add the same check to mc146818_get_time(), warn once when the condition
is true and invalidate the rtc_time data.
Reported-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Mickaël Salaün <mic@linux.microsoft.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/87tur3fx7w.fsf@nanos.tec.linutronix.de
Diffstat (limited to 'mm/page_alloc.c')
0 files changed, 0 insertions, 0 deletions