===================================================================
@@ -197,6 +197,7 @@ extern void irq_wake_thread(unsigned int
/* The following three functions are for the core kernel use only. */
extern void suspend_device_irqs(void);
extern void resume_device_irqs(void);
+extern void set_wakeup_irqs(bool enable);
#ifdef CONFIG_PM_SLEEP
extern int check_wakeup_irqs(void);
#else
===================================================================
@@ -130,3 +130,28 @@ int check_wakeup_irqs(void)
return 0;
}
+
+void set_wakeup_irqs(bool enable)
+{
+ struct irq_desc *desc;
+ int irq;
+
+ for_each_irq_desc(irq, desc) {
+ unsigned long flags;
+
+ raw_spin_lock_irqsave(&desc->lock, flags);
+
+ if (desc->action && irqd_is_wakeup_set(&desc->irq_data) &&
+ !desc->skip_suspend) {
+ if (enable) {
+ desc->istate &= ~IRQS_SUSPENDED;
+ __enable_irq(desc, irq, false);
+ } else if (!(desc->istate & IRQS_SUSPENDED)) {
+ __disable_irq(desc, irq, false);
+ desc->istate |= IRQS_SUSPENDED;
+ }
+ }
+
+ raw_spin_unlock_irqrestore(&desc->lock, flags);
+ }
+}
===================================================================
@@ -12,6 +12,7 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/init.h>
+#include <linux/interrupt.h>
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/cpuidle.h>
@@ -55,7 +56,9 @@ static void freeze_enter(void)
{
cpuidle_use_deepest_state(true);
cpuidle_resume();
+ set_wakeup_irqs(true);
wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
+ set_wakeup_irqs(false);
cpuidle_pause();
cpuidle_use_deepest_state(false);
}
===================================================================
@@ -276,8 +276,11 @@ try_misrouted_irq(unsigned int irq, stru
void note_interrupt(unsigned int irq, struct irq_desc *desc,
irqreturn_t action_ret)
{
- if (unlikely(irqs_suspended && action_ret == IRQ_NONE)) {
- pr_err("IRQ %d: Unhandled while suspended\n", irq);
+ if (unlikely(irqs_suspended &&
+ (action_ret == IRQ_NONE || irqd_is_wakeup_set(&desc->irq_data)))) {
+ if (!irqd_is_wakeup_set(&desc->irq_data))
+ pr_err("IRQ %d: Unhandled while suspended\n", irq);
+
desc->istate |= IRQS_SUSPENDED;
desc->depth++;
irq_disable(desc);