OSDN Git Service

ACPI: PM: Print debug messages on device power state changes
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Aug 2019 10:26:02 +0000 (12:26 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Aug 2019 09:32:51 +0000 (11:32 +0200)
Add an acpi_handle_debug() statement to acpi_device_set_power() to
allow ACPI device power state changes to be tracked.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_pm.c

index f616b16..4cb93d4 100644 (file)
@@ -166,6 +166,10 @@ int acpi_device_set_power(struct acpi_device *device, int state)
            || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD))
                return -EINVAL;
 
+       acpi_handle_debug(device->handle, "Power state change: %s -> %s\n",
+                         acpi_power_state_string(device->power.state),
+                         acpi_power_state_string(state));
+
        /* Make sure this is a valid target state */
 
        /* There is a special case for D0 addressed below. */