aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-03-16 17:33:49 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2009-03-30 15:46:54 -0400
commit0a0c5168df270a50e3518e4f12bddb31f8f5f38f (patch)
treeea1e392fef9d52a7b81c9010580c09317a4d707d /include/linux
parent019abbc87025a030fd25008612afd4eff8a375f7 (diff)
PM: Introduce functions for suspending and resuming device interrupts
Introduce helper functions allowing us to prevent device drivers from getting any interrupts (without disabling interrupts on the CPU) during suspend (or hibernation) and to make them start to receive interrupts again during the subsequent resume. These functions make it possible to keep timer interrupts enabled while the "late" suspend and "early" resume callbacks provided by device drivers are being executed. In turn, this allows device drivers' "late" suspend and "early" resume callbacks to sleep, execute ACPI callbacks etc. The functions introduced here will be used to rework the handling of interrupts during suspend (hibernation) and resume. Namely, interrupts will only be disabled on the CPU right before suspending sysdevs, while device drivers will be prevented from receiving interrupts, with the help of the new helper function, before their "late" suspend callbacks run (and analogously during resume). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/interrupt.h9
-rw-r--r--include/linux/irq.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 0c9cb63e6895..c68bffd182bb 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -117,6 +117,15 @@ extern void disable_irq_nosync(unsigned int irq);
117extern void disable_irq(unsigned int irq); 117extern void disable_irq(unsigned int irq);
118extern void enable_irq(unsigned int irq); 118extern void enable_irq(unsigned int irq);
119 119
120/* The following three functions are for the core kernel use only. */
121extern void suspend_device_irqs(void);
122extern void resume_device_irqs(void);
123#ifdef CONFIG_PM_SLEEP
124extern int check_wakeup_irqs(void);
125#else
126static inline int check_wakeup_irqs(void) { return 0; }
127#endif
128
120#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) 129#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
121 130
122extern cpumask_var_t irq_default_affinity; 131extern cpumask_var_t irq_default_affinity;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 9c62fbe2ef30..974890b3c52f 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -67,6 +67,7 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
67#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */ 67#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */
68#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */ 68#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */
69#define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/ 69#define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/
70#define IRQ_SUSPENDED 0x04000000 /* IRQ has gone through suspend sequence */
70 71
71#ifdef CONFIG_IRQ_PER_CPU 72#ifdef CONFIG_IRQ_PER_CPU
72# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 73# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)