rtc: mc146818: Dont test for bit 0-5 in Register D
authorThomas Gleixner <tglx@linutronix.de>
Mon, 1 Feb 2021 19:24:17 +0000 (20:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:31:55 +0000 (11:31 +0100)
commitf5b51f855036e39456ac36aadc7078ac583c5932
tree832838e10a9e5303c9c83e33326e0f21c872b72d
parent3736972360fad22805e7e9d322387fd1ec0f48fc
rtc: mc146818: Dont test for bit 0-5 in Register D

[ Upstream commit ebb22a05943666155e6da04407cc6e913974c78c ]

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
Stable-dep-of: cd17420ebea5 ("rtc: cmos: avoid UIP when writing alarm time")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-cmos.c
drivers/rtc/rtc-mc146818-lib.c