]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtc: pm8xxx: fix set-alarm race
authorJohan Hovold <johan+linaro@kernel.org>
Thu, 2 Feb 2023 15:54:27 +0000 (16:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:26:44 +0000 (16:26 +0100)
commit9dd9ad0745fba43ea69c29cbfae7a390bf477a92
treec97636bc1b78fa9fcd5fba5774e658bac7d2810c
parent31e2120cfadbf16e2762e674299b8a277b734d8a
rtc: pm8xxx: fix set-alarm race

commit c88db0eff9722fc2b6c4d172a50471d20e08ecc6 upstream.

Make sure to disable the alarm before updating the four alarm time
registers to avoid spurious alarms during the update.

Note that the disable needs to be done outside of the ctrl_reg_lock
section to prevent a racing alarm interrupt from disabling the newly set
alarm when the lock is released.

Fixes: 9a9a54ad7aa2 ("drivers/rtc: add support for Qualcomm PMIC8xxx RTC")
Cc: stable@vger.kernel.org # 3.1
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: David Collins <quic_collinsd@quicinc.com>
Link: https://lore.kernel.org/r/20230202155448.6715-2-johan+linaro@kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-pm8xxx.c