Skip to content

Commit 8875962

Browse files
colincrossrjwysocki
authored andcommitted
PM: Reintroduce dropped call to check_wakeup_irqs
Patch 2e711c0 (PM: Remove sysdev suspend, resume and shutdown operations) deleted sysdev_suspend(), which was being relied on to call check_wakeup_irqs() in suspend. If check_wakeup_irqs() is not called, wake interrupts that are pending when suspend is entered may be lost. It also breaks IRQCHIP_MASK_ON_SUSPEND, which is handled in check_wakeup_irqs(). This patch adds a call to check_wakeup_irqs() in syscore_suspend(), similar to what was deleted in sysdev_suspend(). Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
1 parent e3bbfa7 commit 8875962

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎drivers/base/syscore.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/syscore_ops.h>
1010
#include <linux/mutex.h>
1111
#include <linux/module.h>
12+
#include <linux/interrupt.h>
1213

1314
static LIST_HEAD(syscore_ops_list);
1415
static DEFINE_MUTEX(syscore_ops_lock);
@@ -48,6 +49,13 @@ int syscore_suspend(void)
4849
struct syscore_ops *ops;
4950
int ret = 0;
5051

52+
pr_debug("Checking wakeup interrupts\n");
53+
54+
/* Return error code if there are any wakeup interrupts pending. */
55+
ret = check_wakeup_irqs();
56+
if (ret)
57+
return ret;
58+
5159
WARN_ONCE(!irqs_disabled(),
5260
"Interrupts enabled before system core suspend.\n");
5361

0 commit comments

Comments
 (0)