[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181220085827.961861032@linuxfoundation.org>
Date: Thu, 20 Dec 2018 10:18:50 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Guy Shapiro <guy.shapiro@...i-wize.com>,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 4.4 38/40] rtc: snvs: add a missing write sync
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 7bb633b1a9812a6b9f3e49d0cf17f60a633914e5 ]
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@...i-wize.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/rtc/rtc-snvs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index a161fbf6f172..af131682dbc9 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -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 */
--
2.19.1
Powered by blists - more mailing lists