PM: Reintroduce dropped call to check_wakeup_irqs
PATCH 1/1 PM: Reintroduce dropped call to check_wakeup_irqs
Patch 2e711c04dbbf7a7732a3f7073b1fc285d12b369d
(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.
--- drivers/base/syscore.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/base/syscore.c +8 -0
@@ -9,6 +9,7 @@#include <linux/syscore_ops.h> #include <linux/mutex.h> #include <linux/module.h> +#include <linux/interrupt.h> static LIST_HEAD (syscore_ops_list);static DEFINE_MUTEX (syscore_ops_lock);
@@ -48,6 +49,13 @@ int syscore_suspend(void)struct syscore_ops *ops;int ret =0 ; +pr_debug ("Checking wake-up interrupts\n" ); + +/* Return error code if there are any wake-up interrupts pending */ + ret =check_wakeup_irqs (); +if (ret) +return ret; +WARN_ONCE (!irqs_disabled (),"Interrupts enabled before system core suspend.\n" );
Signature · 1 line
1.7.4.1
Quoted 8 lines · Colin Cross
Patch
2e711c04dbbf7a7732a3f7073b1fc285d12b369d
(PM: Remove sysdev suspend, resume and shutdown operations) deletedsysdev_suspend, which was being relied on to callcheck_wakeup_irqsin suspend. Ifcheck_wakeup_irqsis not called, wake interrupts that are pending when suspend is entered may be lost. It also breaksIRQCHIP_MASK_ON_SUSPEND, which is handled incheck_wakeup_irqs.
Quoted 7 lines
This patch adds a call to
check_wakeup_irqsinsyscore_suspend, similar to what was deleted insysdev_suspend.CC Rafael J. Wysocki <[email protected]>CC Thomas Gleixner <[email protected]>CC Greg Kroah-Hartman <[email protected]>Signed-off-by Colin Cross <[email protected]>
Thanks a lot for the patch and sorry for the breakage.
I'll push it to Linus later today (hopefully, that's not to late for 3.0).
Thanks,
Rafael
Quoted 31 lines
--- drivers/base/syscore.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)drivers/base/syscore.c +8
-0@@ -9,6 +9,7 @@#include <linux/syscore_ops.h> #include <linux/mutex.h> #include <linux/module.h> +#include <linux/interrupt.h> static LIST_HEAD (syscore_ops_list);static DEFINE_MUTEX (syscore_ops_lock);@@ -48,6 +49,13 @@ int syscore_suspend(void)struct syscore_ops *ops;int ret =0 ; +pr_debug ("Checking wake-up interrupts\n" ); + +/* Return error code if there are any wake-up interrupts pending */ + ret =check_wakeup_irqs (); +if (ret) +return ret; +WARN_ONCE (!irqs_disabled (),"Interrupts enabled before system core suspend.\n" );
Quoted 8 lines · Colin Cross
Patch
2e711c04dbbf7a7732a3f7073b1fc285d12b369d
(PM: Remove sysdev suspend, resume and shutdown operations) deletedsysdev_suspend, which was being relied on to callcheck_wakeup_irqsin suspend. Ifcheck_wakeup_irqsis not called, wake interrupts that are pending when suspend is entered may be lost. It also breaksIRQCHIP_MASK_ON_SUSPEND, which is handled incheck_wakeup_irqs.
Quoted 7 lines
This patch adds a call to
check_wakeup_irqsinsyscore_suspend, similar to what was deleted insysdev_suspend.CC Rafael J. Wysocki <[email protected]>CC Thomas Gleixner <[email protected]>CC Greg Kroah-Hartman <[email protected]>Signed-off-by Colin Cross <[email protected]>
Thanks a lot for the patch and sorry for the breakage.
I'll push it to Linus later today (hopefully, that's not to late for 3.0).
Thanks,
Rafael
Quoted 31 lines
--- drivers/base/syscore.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)drivers/base/syscore.c +8
-0@@ -9,6 +9,7 @@#include <linux/syscore_ops.h> #include <linux/mutex.h> #include <linux/module.h> +#include <linux/interrupt.h> static LIST_HEAD (syscore_ops_list);static DEFINE_MUTEX (syscore_ops_lock);@@ -48,6 +49,13 @@ int syscore_suspend(void)struct syscore_ops *ops;int ret =0 ; +pr_debug ("Checking wake-up interrupts\n" ); + +/* Return error code if there are any wake-up interrupts pending */ + ret =check_wakeup_irqs (); +if (ret) +return ret; +WARN_ONCE (!irqs_disabled (),"Interrupts enabled before system core suspend.\n" );