summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGuy Shapiro <guy.shapiro@mobi-wize.com>2017-01-29 11:57:19 +0200
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit26047137328772f79b4cc127d934e7ac1cac07f5 (patch)
treeb6d9f7c0a1e2cef1db74a9489ca7de6d6ad1fe70 /drivers/rtc
parent65adbeb7dfc67a785fa1ec828c115d1b36d4dce2 (diff)
MLK-13798: rtc: snvs: add a missing write sync
The clear of the LPTA_EN flag should be synced before writing to the alarm register. Omitting this synchronization creates a race when trying to change existing alarm. (cherry picked from commit 7bb633b1a9812a6b9f3e49d0cf17f60a633914e5) Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Octavian Purdila <octavian.purdila@nxp.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-snvs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index 31effe234b3d..536d71c4c6f8 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -196,6 +196,7 @@ static int snvs_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
rtc_tm_to_time(alrm_tm, &time);
regmap_update_bits(data->regmap, data->offset + SNVS_LPCR, SNVS_LPCR_LPTA_EN, 0);
+ rtc_write_sync_lp(data);
regmap_write(data->regmap, data->offset + SNVS_LPTAR, time);
/* Clear alarm interrupt status bit */