]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ACPI / PM: Split acpi_device_wakeup()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 21 Jul 2017 12:40:49 +0000 (14:40 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 1 Aug 2017 12:05:03 +0000 (14:05 +0200)
commit99d8845e756cb91e2865f430401d084cd6a8ccc9
tree307036f9315aaf8df9f06add1a2b1012ef214720
parentbaecc470d5fd6e2d94eb2a7e242ba291ac7182ac
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>
drivers/acpi/device_pm.c
include/acpi/acpi_bus.h