1
0
Fork 0
remarkable-linux/drivers/base/power
Rafael J. Wysocki 1364055c96 PM / core: Clear the direct_complete flag on errors
commit 69e445ab8b upstream.

If __device_suspend() runs asynchronously (in which case the device
passed to it is in dpm_suspended_list at that point) and it returns
early on an error or pending wakeup, and the power.direct_complete
flag has been set for the device already, the subsequent
device_resume() will be confused by that and it will call
pm_runtime_enable() incorrectly, as runtime PM has not been
disabled for the device by __device_suspend().

To avoid that, clear power.direct_complete if __device_suspend()
is not going to disable runtime PM for the device before returning.

Fixes: aae4518b31 (PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily)
Reported-by: Al Cooper <alcooperx@gmail.com>
Tested-by: Al Cooper <alcooperx@gmail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-13 09:27:25 +02:00
..
opp PM / OPP: Update voltage in case freq == old_freq 2018-07-03 11:24:47 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
clock_ops.c PM / clk: signedness bug in of_pm_clk_add_clks() 2018-09-05 09:26:42 +02:00
common.c PM: Avoid false-positive warnings in dev_pm_domain_set() 2016-02-03 19:10:37 +01:00
domain.c PM / Domains: Fix error path during attach in genpd 2018-07-03 11:24:47 +02:00
domain_governor.c PM / Domains: Fix missing default_power_down_ok comment 2017-06-29 01:24:36 +02:00
generic_ops.c PM / PCI / ACPI: Kick devices that might have been reset by firmware 2015-10-14 02:17:34 +02:00
main.c PM / core: Clear the direct_complete flag on errors 2018-10-13 09:27:25 +02:00
power.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qos.c PM / QoS: Use the correct variable to check the QoS request type 2017-09-18 13:38:30 +02:00
runtime.c PM / runtime: Fix handling of suppliers with disabled runtime PM 2018-02-25 11:07:58 +01:00
sysfs.c PM / QoS: return -EINVAL for bogus strings 2017-07-12 14:42:37 +02:00
trace.c timekeeping: Ignore the bogus sleep time if pm_trace is enabled 2016-11-29 18:02:58 +01:00
wakeirq.c PM / wakeirq: Fix unbalanced IRQ enable for wakeirq 2018-04-26 11:02:20 +02:00
wakeup.c Merge branch 'pm-sleep' 2017-09-04 00:06:02 +02:00