rtc: snvs: fix wakealarm by call enable_irq_wake earlier
authorStefan Agner <stefan@agner.ch>
Thu, 21 May 2015 15:29:35 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:01 +0000 (09:29 -0700)
commit29c1b3c87b50260525575d260efd6af66a25bf4d
tree4a627268f43620dc2f65fbbde4b277402597b671
parent0268313777f9ff4c61adfee1b726dbde2f68ed44
rtc: snvs: fix wakealarm by call enable_irq_wake earlier

commit 119434f44c78df8c4b6d67f835448542a4bd7e91 upstream.

When entering suspend while an wakeup alarm is set, enable_set_wake
should make sure that the RTC interrupt keep being enabled and the
.irq_set_wake for the RTC interrupt get called. However, since the
driver uses the suspend_noirq callback, the call to enable_irq_wake
has been made after disabling the interrupts. While .irq_set_wake
has been called properly, the interrupt remained disabled.

Use the suspend callback to call enable_irq_wake early enough to
ensure the RTC interrupt remains enabled.

Fixes: 7654e9d4fd8f ("drivers/rtc/rtc-snvs: fix suspend/resume")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-snvs.c