diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-11-16 21:06:17 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-11-24 17:32:52 +0100 |
commit | 5b6a8f1445bc86e221da85bb67f389c3ab6d2037 (patch) | |
tree | 6032b92511556e09d3e0520e4f180a960112dd54 | |
parent | 136057256686de39cc3a07c2e39ef6bc43003ff6 (diff) |
ACPI: PM: Emit debug messages when enabling/disabling wakeup power
Print additional debug messages when enabling and disabling wakeup
power for an ACPI device object to facilitate more fine-grained
debugging of problems in that area.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/power.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 5dcb02ededbc..7945e60f9b6a 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -716,6 +716,9 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state) mutex_lock(&acpi_device_lock); + dev_dbg(&dev->dev, "Enabling wakeup power (count %d)\n", + dev->wakeup.prepare_count); + if (dev->wakeup.prepare_count++) goto out; @@ -734,8 +737,11 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state) if (err) { acpi_power_off_list(&dev->wakeup.resources); dev->wakeup.prepare_count = 0; + goto out; } + dev_dbg(&dev->dev, "Wakeup power enabled\n"); + out: mutex_unlock(&acpi_device_lock); return err; @@ -757,6 +763,9 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev) mutex_lock(&acpi_device_lock); + dev_dbg(&dev->dev, "Disabling wakeup power (count %d)\n", + dev->wakeup.prepare_count); + /* Do nothing if wakeup power has not been enabled for this device. */ if (dev->wakeup.prepare_count <= 0) goto out; @@ -782,8 +791,11 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev) if (err) { dev_err(&dev->dev, "Cannot turn off wakeup power resources\n"); dev->wakeup.flags.valid = 0; + goto out; } + dev_dbg(&dev->dev, "Wakeup power disabled\n"); + out: mutex_unlock(&acpi_device_lock); return err; |