Skip to content

Commit

Permalink
rtc: goldfish: Enable interrupt in set_alarm() when necessary
Browse files Browse the repository at this point in the history
[ Upstream commit 22f8d5a ]

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>
  • Loading branch information
chenhuacai authored and gregkh committed Aug 26, 2020
1 parent e055ffe commit b0eecd0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/rtc/rtc-goldfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0eecd0

Please sign in to comment.