mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Reviewed-by: Mika Westerberg <[email protected]>
This commit is contained in:
parent
baecc470d5
commit
99d8845e75
2 changed files with 80 additions and 43 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue