#include <mach/sec_debug.h>
#include "internals.h"
-
+#ifdef CONFIG_SLP_WAKEUP_COUNT
+#include <linux/suspend.h>
+static DEFINE_SPINLOCK(wakeup_status_lock);
+#endif
/**
* handle_bad_irq - handle spurious and unhandled irqs
* @irq: the interrupt number
handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
{
irqreturn_t retval = IRQ_NONE;
- unsigned int random = 0, irq = desc->irq_data.irq;
+ unsigned int flags = 0, irq = desc->irq_data.irq;
do {
irqreturn_t res;
/* Fall through to add to randomness */
case IRQ_HANDLED:
- random |= action->flags;
+ flags |= action->flags;
break;
default:
action = action->next;
} while (action);
- if (random & IRQF_SAMPLE_RANDOM)
- add_interrupt_randomness(irq);
+ add_interrupt_randomness(irq, flags);
if (!noirqdebug)
note_interrupt(irq, desc, retval);
{
struct irqaction *action = desc->action;
irqreturn_t ret;
+#ifdef CONFIG_SLP_WAKEUP_COUNT
+ unsigned long irqflags;
+#endif
desc->istate &= ~IRQS_PENDING;
irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
raw_spin_unlock(&desc->lock);
+#ifdef CONFIG_SLP_WAKEUP_COUNT
+ spin_lock_irqsave(&wakeup_status_lock, irqflags); /* to be safe */
+ if (wakeup_state) {
+ raw_spin_lock(&desc->lock);
+ desc->hit_in_sleep++;
+ raw_spin_unlock(&desc->lock);
+ wakeup_state = 0;
+ }
+ spin_unlock_irqrestore(&wakeup_status_lock, irqflags);
+#endif
ret = handle_irq_event_percpu(desc, action);