Hello, This patch series fixes some issues in the RTC CMOS handling code. First three patches fix bugs in drivers/rtc: 1. Fix rtc_lock usage in cmos_set_alarm() in rtc-cmos.c. 2. Do not touch RTC alarm registers when the RTC update is in progress. (On some Intel chipsets, this causes bogus values being read or writes to fail silently.) 3. Fix presence check of the RTC CMOS: the clock was misdetected as broken on one of my systems. Patches 1 and 2 are Cced stable. I'm going to submit patch 3 manually to stable after some regression testing in master. Next three patches contain fixes for arch/x86/rtc.c: duplicate code removal and a renaming of a function. The final patch reverts a buggy commit - to prevent a possible deadlock at resume from suspend. I'm also considering whether function x86_wallclock_init() in arch/x86/kernel/x86_init.c should call mc146818_does_rtc_work() to make sure that the CMOS RTC is present and behaves itself. This might be useful. Tested on top of v5.14.2, on two systems. This is my first patch series, so please review carefully. Greetings, Mateusz Signed-off-by: Mateusz Jończyk <mat.jonczyk@xxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: Borislav Petkov <bp@xxxxxxxxx> Cc: x86@xxxxxxxxxx Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Cc: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>