PM: sleep: stats: Call dpm_save_failed_step() at most once per phase
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 29 Jan 2024 16:24:04 +0000 (17:24 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 5 Feb 2024 13:28:54 +0000 (14:28 +0100)
commit4add3e72f0fca0c66a8c9de8f58997eb9a3e3320
tree22e95a8efaef58f25887ceb9cb61b797abb523d5
parent9ff544fa5f94fe07f99a36d2138075b322067546
PM: sleep: stats: Call dpm_save_failed_step() at most once per phase

If the handling of two or more devices fails in one suspend-resume
phase, it should be counted once in the statistics which is not
guaranteed to happen during system-wide resume of devices due to
the possible asynchronous execution of device callbacks.

Address this by using the async_error static variable during system-wide
device resume to indicate that there has been a device resume error and
the given suspend-resume phase should be counted as failing.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/base/power/main.c