diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-21 14:40:49 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-08-01 14:05:03 +0200 |
commit | 99d8845e756cb91e2865f430401d084cd6a8ccc9 (patch) | |
tree | 307036f9315aaf8df9f06add1a2b1012ef214720 /include | |
parent | baecc470d5fd6e2d94eb2a7e242ba291ac7182ac (diff) | |
download | linux-stable-99d8845e756cb91e2865f430401d084cd6a8ccc9.tar.gz linux-stable-99d8845e756cb91e2865f430401d084cd6a8ccc9.tar.bz2 linux-stable-99d8845e756cb91e2865f430401d084cd6a8ccc9.zip |
ACPI / PM: Split acpi_device_wakeup()
To prepare for a subsequent change and make the code somewhat easier
to follow, do the following in the ACPI device wakeup handling code:
* Replace wakeup.flags.enabled under struct acpi_device with
wakeup.enable_count as that will be necessary going forward.
For now, wakeup.enable_count is not allowed to grow beyond 1,
so the current behavior is retained.
* Split acpi_device_wakeup() into acpi_device_wakeup_enable()
and acpi_device_wakeup_disable() and modify the callers of
it accordingly.
* Introduce a new acpi_wakeup_lock mutex to protect the wakeup
enabling/disabling code from races in case it is executed
more than once in parallel for the same device (which may
happen for bridges theoretically).
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/acpi_bus.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 68bc6be447fd..b7df95dbe7e9 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -316,7 +316,6 @@ struct acpi_device_perf { struct acpi_device_wakeup_flags { u8 valid:1; /* Can successfully enable wakeup? */ u8 notifier_present:1; /* Wake-up notify handler has been installed */ - u8 enabled:1; /* Enabled for wakeup */ }; struct acpi_device_wakeup_context { @@ -333,6 +332,7 @@ struct acpi_device_wakeup { struct acpi_device_wakeup_context context; struct wakeup_source *ws; int prepare_count; + int enable_count; }; struct acpi_device_physical_node { |