]> git.baikalelectronics.ru Git - kernel.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>
Fri, 10 Mar 2023 08:34:02 +0000 (09:34 +0100)
commitcaa266d4e976200d9a65d18d914b662af8ee7706
tree4748de17dd9b339f964f6fb841938be09df24471
parentdc8d038fc6ab8b411adb9a87b7e6fd1d77e1a498
rtc: pm8xxx: fix set-alarm race

commit 1f82757b96c82d0da757ac222b479dc73de8e151 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: 8b34661e0495 ("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