summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGuy Shapiro <guy.shapiro@mobi-wize.com>2017-01-29 11:57:19 +0200
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-02-01 12:44:24 +0100
commit7bb633b1a9812a6b9f3e49d0cf17f60a633914e5 (patch)
tree2914abe3ded18f7ca5a5093bb108593358519b8f /drivers
parent4c466872d8ae8e3cdc3e5e1a47e28a15e3020d8b (diff)
downloadlinux-7bb633b1a9812a6b9f3e49d0cf17f60a633914e5.tar.gz
linux-7bb633b1a9812a6b9f3e49d0cf17f60a633914e5.tar.bz2
linux-7bb633b1a9812a6b9f3e49d0cf17f60a633914e5.zip
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. Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers')
-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 0f11c2a228e3..d51b07d620f7 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -184,6 +184,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 */