diff options
author | Huacai Chen <chenhc@lemote.com> | 2020-06-20 20:04:43 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-08-26 10:29:55 +0200 |
commit | 59e8bcc1f6fa6512786c6b703496bc6d3446f5c2 (patch) | |
tree | 6256dcd3edc7b8903b4e5031809f8fad399f2404 /drivers/rtc | |
parent | 87f1b49ee84f63f49bdba5e67e836d06117f59b5 (diff) | |
download | linux-stable-59e8bcc1f6fa6512786c6b703496bc6d3446f5c2.tar.gz linux-stable-59e8bcc1f6fa6512786c6b703496bc6d3446f5c2.tar.bz2 linux-stable-59e8bcc1f6fa6512786c6b703496bc6d3446f5c2.zip |
rtc: goldfish: Enable interrupt in set_alarm() when necessary
[ Upstream commit 22f8d5a1bf230cf8567a4121fc3789babb46336d ]
When use goldfish rtc, the "hwclock" command fails with "select() to
/dev/rtc to wait for clock tick timed out". This is because "hwclock"
need the set_alarm() hook to enable interrupt when alrm->enabled is
true. This operation is missing in goldfish rtc (but other rtc drivers,
such as cmos rtc, enable interrupt here), so add it.
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1592654683-31314-1-git-send-email-chenhc@lemote.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-goldfish.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-goldfish.c b/drivers/rtc/rtc-goldfish.c index a1c44d0c8557..30cbe22c57a8 100644 --- a/drivers/rtc/rtc-goldfish.c +++ b/drivers/rtc/rtc-goldfish.c @@ -87,6 +87,7 @@ static int goldfish_rtc_set_alarm(struct device *dev, rtc_alarm64 = rtc_alarm * NSEC_PER_SEC; writel((rtc_alarm64 >> 32), base + TIMER_ALARM_HIGH); writel(rtc_alarm64, base + TIMER_ALARM_LOW); + writel(1, base + TIMER_IRQ_ENABLED); } else { /* * if this function was called with enabled=0 |