]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
UBUNTU: SAUCE: drivers/rtc/interface.c: ignore exprired times when enqueing new timers
authorColin Ian King <colin.king@canonical.com>
Tue, 6 Jan 2015 12:48:57 +0000 (12:48 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Fri, 26 Feb 2016 02:44:02 +0000 (19:44 -0700)
commit61331a591b4284d54d3af5d59e487a463406d408
tree20c99f6be9bb2d647aa45195f3ae6537c466d2e9
parent6ac65b6e19d2d6f6e0b093ea0c039ca3116f8617
UBUNTU: SAUCE: drivers/rtc/interface.c: ignore exprired times when enqueing new timers

BugLink: http://bugs.launchpad.net/bugs/1333569
This patch fixes a RTC wakealarm issue, namely, the event fires during
hibernate and is not cleared from the list, causing hwlock to block.
The original fix has been sent to LKML twice [1] but has had no response
and not yet been picked up. Rather than wait for ever for the maintainter
to pick it up, I'm sending it as a fix for Vivid.

[1] https://lkml.org/lkml/2014/9/26/70

Note that the skipped expired timer events get reaped later on, so we
don't bother reaping them in this fix, instead ignoring them is the best
strategy.

The current enqueuing does not trigger an alarm if any expired timers
already exist on the timerqueue. This can occur when a RTC wake alarm
is used to wake a machine out of hibernate and the resumed state has
old expired timers that have not been removed from the timer queue.
This fix skips over any expired timers and triggers an alarm if there
are no pending timers on the timerqueue.

The bug was found running the example RTC timer program from
Documentation/rtc.txt; it runs fine before a hibernate but will block
forever on RTC reads after a resume from a hibernate that is woken
up using a RTC wakealarm.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
drivers/rtc/interface.c