Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: goldfish: Enable interrupt in set_alarm() when necessary

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

authored by

Huacai Chen and committed by
Alexandre Belloni
22f8d5a1 d8f090db

+1
+1
drivers/rtc/rtc-goldfish.c
··· 73 73 rtc_alarm64 = rtc_tm_to_time64(&alrm->time) * NSEC_PER_SEC; 74 74 writel((rtc_alarm64 >> 32), base + TIMER_ALARM_HIGH); 75 75 writel(rtc_alarm64, base + TIMER_ALARM_LOW); 76 + writel(1, base + TIMER_IRQ_ENABLED); 76 77 } else { 77 78 /* 78 79 * if this function was called with enabled=0