aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r--kernel/power/main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index a064dfd8877a..3062e940d1fa 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -111,13 +111,24 @@ static int suspend_prepare(suspend_state_t state)
111 return error; 111 return error;
112} 112}
113 113
114/* default implementation */
115void __attribute__ ((weak)) arch_suspend_disable_irqs(void)
116{
117 local_irq_disable();
118}
119
120/* default implementation */
121void __attribute__ ((weak)) arch_suspend_enable_irqs(void)
122{
123 local_irq_enable();
124}
114 125
115int suspend_enter(suspend_state_t state) 126int suspend_enter(suspend_state_t state)
116{ 127{
117 int error = 0; 128 int error = 0;
118 unsigned long flags;
119 129
120 local_irq_save(flags); 130 arch_suspend_disable_irqs();
131 BUG_ON(!irqs_disabled());
121 132
122 if ((error = device_power_down(PMSG_SUSPEND))) { 133 if ((error = device_power_down(PMSG_SUSPEND))) {
123 printk(KERN_ERR "Some devices failed to power down\n"); 134 printk(KERN_ERR "Some devices failed to power down\n");
@@ -126,7 +137,8 @@ int suspend_enter(suspend_state_t state)
126 error = pm_ops->enter(state); 137 error = pm_ops->enter(state);
127 device_power_up(); 138 device_power_up();
128 Done: 139 Done:
129 local_irq_restore(flags); 140 arch_suspend_enable_irqs();
141 BUG_ON(irqs_disabled());
130 return error; 142 return error;
131} 143}
132 144