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>
This commit is contained in:
parent
4c466872d8
commit
7bb633b1a9
@ -184,6 +184,7 @@ static int snvs_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
|||||||
rtc_tm_to_time(alrm_tm, &time);
|
rtc_tm_to_time(alrm_tm, &time);
|
||||||
|
|
||||||
regmap_update_bits(data->regmap, data->offset + SNVS_LPCR, SNVS_LPCR_LPTA_EN, 0);
|
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);
|
regmap_write(data->regmap, data->offset + SNVS_LPTAR, time);
|
||||||
|
|
||||||
/* Clear alarm interrupt status bit */
|
/* Clear alarm interrupt status bit */
|
||||||
|
Loading…
Reference in New Issue
Block a user