aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-22 19:00:45 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-22 19:00:45 -0400
commitc072530f391e33bd22ed0638c08f07528f154493 (patch)
tree559f1730fb64797831086b2e41feded7d72e7226 /include/acpi
parent28cb5ef16e578bbca0a562b09f12c8c98ca92720 (diff)
ACPI / PM: Revork the handling of ACPI device wakeup notifications
Since ACPI wakeup GPEs are going to be enabled during system suspend as well as for runtime wakeup by a subsequent patch and the same notify handlers will be used in both cases, rework the ACPI device wakeup notification framework so that the part specific to physical devices is always run asynchronously from the PM workqueue. This prevents runtime resume callbacks for those devices from being run during system suspend and resume which may not be appropriate, among other things. Also make ACPI device wakeup notification handling a bit more robust agaist subsequent removal of ACPI device objects, whould that ever happen, and create a wakeup source object for each ACPI device configured for wakeup so that wakeup notifications for those devices can wake up the system from the "freeze" sleep state. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpi_bus.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index b5714580801a..99780d46abb6 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -315,12 +315,19 @@ struct acpi_device_wakeup_flags {
315 u8 notifier_present:1; /* Wake-up notify handler has been installed */ 315 u8 notifier_present:1; /* Wake-up notify handler has been installed */
316}; 316};
317 317
318struct acpi_device_wakeup_context {
319 struct work_struct work;
320 struct device *dev;
321};
322
318struct acpi_device_wakeup { 323struct acpi_device_wakeup {
319 acpi_handle gpe_device; 324 acpi_handle gpe_device;
320 u64 gpe_number; 325 u64 gpe_number;
321 u64 sleep_state; 326 u64 sleep_state;
322 struct list_head resources; 327 struct list_head resources;
323 struct acpi_device_wakeup_flags flags; 328 struct acpi_device_wakeup_flags flags;
329 struct acpi_device_wakeup_context context;
330 struct wakeup_source *ws;
324 int prepare_count; 331 int prepare_count;
325}; 332};
326 333
@@ -510,20 +517,18 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
510int acpi_disable_wakeup_device_power(struct acpi_device *dev); 517int acpi_disable_wakeup_device_power(struct acpi_device *dev);
511 518
512#ifdef CONFIG_PM 519#ifdef CONFIG_PM
513acpi_status acpi_add_pm_notifier(struct acpi_device *adev, 520acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
514 acpi_notify_handler handler, void *context); 521 void (*work_func)(struct work_struct *work));
515acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 522acpi_status acpi_remove_pm_notifier(struct acpi_device *adev);
516 acpi_notify_handler handler);
517int acpi_pm_device_sleep_state(struct device *, int *, int); 523int acpi_pm_device_sleep_state(struct device *, int *, int);
518#else 524#else
519static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, 525static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
520 acpi_notify_handler handler, 526 struct device *dev,
521 void *context) 527 void (*work_func)(struct work_struct *work))
522{ 528{
523 return AE_SUPPORT; 529 return AE_SUPPORT;
524} 530}
525static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 531static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev)
526 acpi_notify_handler handler)
527{ 532{
528 return AE_SUPPORT; 533 return AE_SUPPORT;
529} 534}