linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: goldfish: Enable interrupt in set_alarm() when necessary
@ 2020-06-20 12:04 Huacai Chen
  2020-07-03  3:00 ` Huacai Chen
  2020-07-16  9:16 ` Alexandre Belloni
  0 siblings, 2 replies; 5+ messages in thread
From: Huacai Chen @ 2020-06-20 12:04 UTC (permalink / raw)
  To: Miodrag Dinic, Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, Fuxin Zhang, Huacai Chen, Jiaxun Yang, Huacai Chen

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>
---
 drivers/rtc/rtc-goldfish.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/rtc-goldfish.c b/drivers/rtc/rtc-goldfish.c
index 1a3420e..d5083b0 100644
--- a/drivers/rtc/rtc-goldfish.c
+++ b/drivers/rtc/rtc-goldfish.c
@@ -73,6 +73,7 @@ static int goldfish_rtc_set_alarm(struct device *dev,
 		rtc_alarm64 = rtc_tm_to_time64(&alrm->time) * 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
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-16  9:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-20 12:04 [PATCH] rtc: goldfish: Enable interrupt in set_alarm() when necessary Huacai Chen
2020-07-03  3:00 ` Huacai Chen
2020-07-09  9:39   ` Huacai Chen
2020-07-09 10:30     ` Miodrag Dinic
2020-07-16  9:16 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).