Skip to content

Commit

Permalink
rtc: snvs: add a missing write sync
Browse files Browse the repository at this point in the history
[ Upstream commit 7bb633b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Guy Shapiro authored and Greg Kroah-Hartman committed Dec 21, 2018
1 parent 36764b4 commit 54dbda7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/rtc/rtc-snvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,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 */
Expand Down

0 comments on commit 54dbda7

Please sign in to comment.