diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-30 14:46:13 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-30 14:46:13 -0400 |
| commit | e4cb0c9e92f7b16db7a1e892ac6bcf2f736dfd50 (patch) | |
| tree | 35d66a4fc97aa642c14483966f050b5663ff02ca /drivers/base | |
| parent | 905563ff47db35dcb3f69e69d434207270ad1966 (diff) | |
| parent | 27f3d18630cd7fbb03b62bd78a74303cb8c88069 (diff) | |
Merge branch 'pm-genirq' into acpi-pm
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/power/wakeup.c | 16 | ||||
| -rw-r--r-- | drivers/base/syscore.c | 7 |
2 files changed, 18 insertions, 5 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index eb1bd2ecad8b..c2744b30d5d9 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c | |||
| @@ -24,6 +24,9 @@ | |||
| 24 | */ | 24 | */ |
| 25 | bool events_check_enabled __read_mostly; | 25 | bool events_check_enabled __read_mostly; |
| 26 | 26 | ||
| 27 | /* If set and the system is suspending, terminate the suspend. */ | ||
| 28 | static bool pm_abort_suspend __read_mostly; | ||
| 29 | |||
| 27 | /* | 30 | /* |
| 28 | * Combined counters of registered wakeup events and wakeup events in progress. | 31 | * Combined counters of registered wakeup events and wakeup events in progress. |
| 29 | * They need to be modified together atomically, so it's better to use one | 32 | * They need to be modified together atomically, so it's better to use one |
| @@ -719,7 +722,18 @@ bool pm_wakeup_pending(void) | |||
| 719 | pm_print_active_wakeup_sources(); | 722 | pm_print_active_wakeup_sources(); |
| 720 | } | 723 | } |
| 721 | 724 | ||
| 722 | return ret; | 725 | return ret || pm_abort_suspend; |
| 726 | } | ||
| 727 | |||
| 728 | void pm_system_wakeup(void) | ||
| 729 | { | ||
| 730 | pm_abort_suspend = true; | ||
| 731 | freeze_wake(); | ||
| 732 | } | ||
| 733 | |||
| 734 | void pm_wakeup_clear(void) | ||
| 735 | { | ||
| 736 | pm_abort_suspend = false; | ||
| 723 | } | 737 | } |
| 724 | 738 | ||
| 725 | /** | 739 | /** |
diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c index dbb8350ea8dc..8d98a329f6ea 100644 --- a/drivers/base/syscore.c +++ b/drivers/base/syscore.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/syscore_ops.h> | 9 | #include <linux/syscore_ops.h> |
| 10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/interrupt.h> | 12 | #include <linux/suspend.h> |
| 13 | #include <trace/events/power.h> | 13 | #include <trace/events/power.h> |
| 14 | 14 | ||
| 15 | static LIST_HEAD(syscore_ops_list); | 15 | static LIST_HEAD(syscore_ops_list); |
| @@ -54,9 +54,8 @@ int syscore_suspend(void) | |||
| 54 | pr_debug("Checking wakeup interrupts\n"); | 54 | pr_debug("Checking wakeup interrupts\n"); |
| 55 | 55 | ||
| 56 | /* Return error code if there are any wakeup interrupts pending. */ | 56 | /* Return error code if there are any wakeup interrupts pending. */ |
| 57 | ret = check_wakeup_irqs(); | 57 | if (pm_wakeup_pending()) |
| 58 | if (ret) | 58 | return -EBUSY; |
| 59 | return ret; | ||
| 60 | 59 | ||
| 61 | WARN_ONCE(!irqs_disabled(), | 60 | WARN_ONCE(!irqs_disabled(), |
| 62 | "Interrupts enabled before system core suspend.\n"); | 61 | "Interrupts enabled before system core suspend.\n"); |
