aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-cmos.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-02-01 20:24:17 +0100
committerThomas Gleixner <tglx@linutronix.de>2021-02-02 20:35:02 +0100
commitebb22a05943666155e6da04407cc6e913974c78c (patch)
tree038aebfe661566d9abe76bf2b20d839e34a820f4 /drivers/rtc/rtc-cmos.c
parent211e5db19d15a721b2953ea54b8f26c2963720eb (diff)
downloadlinux-ebb22a05943666155e6da04407cc6e913974c78c.tar.gz
rtc: mc146818: Dont test for bit 0-5 in Register D
The recent change to validate the RTC turned out to be overly tight. While it cures the problem on the reporters machine it breaks machines with Intel chipsets which use bit 0-5 of the D register. So check only for bit 6 being 0 which is the case on these Intel machines as well. Fixes: 211e5db19d15 ("rtc: mc146818: Detect and handle broken RTCs") Reported-by: Serge Belyshev <belyshev@depni.sinp.msu.ru> Reported-by: Dirk Gouders <dirk@gouders.net> Reported-by: Borislav Petkov <bp@suse.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Dirk Gouders <dirk@gouders.net> Tested-by: Len Brown <len.brown@intel.com> Tested-by: Borislav Petkov <bp@suse.de> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/87zh0nbnha.fsf@nanos.tec.linutronix.de
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r--drivers/rtc/rtc-cmos.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 68a9ac6f2fe17..a701dae653c4a 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -805,8 +805,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
spin_lock_irq(&rtc_lock);
- /* Ensure that the RTC is accessible. Bit 0-6 must be 0! */
- if ((CMOS_READ(RTC_VALID) & 0x7f) != 0) {
+ /* 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;