diff options
author | Ingo Molnar <mingo@kernel.org> | 2021-02-12 12:54:51 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-02-12 12:54:58 +0100 |
commit | 62137364e3e8afcc745846c5c67cacf943149073 (patch) | |
tree | 42f2bdee6b16e383b6e0a94cb3abc62f335d721a /drivers/rtc/rtc-cmos.c | |
parent | 6c80408a8a0360fa9223b8c21c0ab8ef42e88bfe (diff) | |
parent | dcc0b49040c70ad827a7f3d58a21b01fdb14e749 (diff) | |
download | linux-62137364e3e8afcc745846c5c67cacf943149073.tar.gz linux-62137364e3e8afcc745846c5c67cacf943149073.tar.bz2 linux-62137364e3e8afcc745846c5c67cacf943149073.zip |
Merge branch 'linus' into locking/core, to pick up upstream fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r-- | drivers/rtc/rtc-cmos.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 51e80bc70d42..a701dae653c4 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -805,6 +805,14 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) spin_lock_irq(&rtc_lock); + /* Ensure that the RTC is accessible. Bit 6 must be 0! */ + if ((CMOS_READ(RTC_VALID) & 0x40) != 0) { + spin_unlock_irq(&rtc_lock); + dev_warn(dev, "not accessible\n"); + retval = -ENXIO; + goto cleanup1; + } + if (!(flags & CMOS_RTC_FLAGS_NOFREQ)) { /* force periodic irq to CMOS reset default of 1024Hz; * |